From 2bd97476a980f4991b114e2f8ba75f980297c3ac Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 17 Jun 2026 21:03:56 -0700 Subject: [PATCH 1/3] fix up list indentation --- xml/System.CodeDom/CodeTypeReference.xml | 16 +- .../BlockingCollection`1.xml | 4 +- .../DisplayColumnAttribute.xml | 6 +- .../DisplayFormatAttribute.xml | 6 +- .../RangeAttribute.xml | 6 +- .../RequiredAttribute.xml | 4 +- xml/System.ComponentModel/BindingList`1.xml | 33 +-- .../ConfigurationCollectionAttribute.xml | 14 +- .../ConfigurationPropertyAttribute.xml | 18 +- .../ConfigurationSection.xml | 18 +- xml/System.Diagnostics.Contracts/Contract.xml | 25 +- xml/System.Diagnostics/Activity.xml | 12 +- .../ActivityTagsCollection.xml | 11 +- .../ConditionalAttribute.xml | 18 +- .../DirectorySearcher.xml | 4 +- xml/System.Globalization/CultureInfo.xml | 4 +- xml/System.IO.Packaging/Package.xml | 8 +- xml/System.Linq.Expressions/Expression.xml | 224 +++++++++--------- xml/System.Printing/PrintCapabilities.xml | 28 +-- .../ModuleResolveEventHandler.xml | 13 +- xml/System.Resources/ResourceReader.xml | 39 +-- xml/System.Resources/ResourceWriter.xml | 12 +- xml/System.Runtime.Caching/ChangeMonitor.xml | 28 +-- .../InternalsVisibleToAttribute.xml | 26 +- .../SEHException.xml | 8 +- .../RecognizedAudio.xml | 18 +- .../SemanticResultValue.xml | 16 +- .../SemanticValue.xml | 4 +- .../EventParameterType.xml | 15 +- .../FragmentState.xml | 13 +- .../SpeechEventInfo.xml | 47 ++-- .../TextFragment.xml | 66 +++--- .../TtsEngineAction.xml | 12 +- .../TtsEngineSsml.xml | 22 +- .../TtsEventId.xml | 13 +- xml/System.Text/Encoding.xml | 4 +- xml/System.Threading.Tasks/Task.xml | 12 +- xml/System.Threading/Thread.xml | 16 +- xml/System.Threading/ThreadPool.xml | 32 +-- xml/System.Xml.Schema/Extensions.xml | 88 +++---- xml/System.Xml.Xsl/XslCompiledTransform.xml | 2 +- xml/System.Xml/XmlWriter.xml | 22 +- xml/System/ArgumentNullException.xml | 2 +- xml/System/ArraySegment`1.xml | 6 +- xml/System/BitConverter.xml | 6 +- xml/System/Console.xml | 26 +- xml/System/DateTime.xml | 20 +- xml/System/DateTimeOffset.xml | 16 +- xml/System/EntryPointNotFoundException.xml | 54 ++--- xml/System/GC.xml | 4 +- xml/System/IEquatable`1.xml | 10 +- xml/System/IndexOutOfRangeException.xml | 96 ++++---- xml/System/IntPtr.xml | 6 +- xml/System/InvalidOperationException.xml | 8 +- xml/System/NullReferenceException.xml | 90 +++---- xml/System/Object.xml | 16 +- xml/System/ObjectDisposedException.xml | 6 +- xml/System/OutOfMemoryException.xml | 8 +- xml/System/OverflowException.xml | 12 +- xml/System/String.xml | 28 +-- xml/System/TimeSpan.xml | 2 +- xml/System/Tuple`2.xml | 12 +- xml/System/Tuple`3.xml | 6 +- xml/System/Tuple`4.xml | 6 +- xml/System/Tuple`5.xml | 6 +- xml/System/Tuple`6.xml | 6 +- xml/System/Tuple`7.xml | 6 +- xml/System/Type.xml | 26 +- xml/System/TypeInitializationException.xml | 4 +- 69 files changed, 695 insertions(+), 780 deletions(-) diff --git a/xml/System.CodeDom/CodeTypeReference.xml b/xml/System.CodeDom/CodeTypeReference.xml index c95abe2af2a..a51d414c504 100644 --- a/xml/System.CodeDom/CodeTypeReference.xml +++ b/xml/System.CodeDom/CodeTypeReference.xml @@ -555,27 +555,27 @@ System.Collections.Generic.Dictionary`2[[System.String], [System.Collections.Gen - The property for the parent returns the following: - ``` + ``` System.Collections.Generic.Dictionary`2 - ``` + ``` - 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: - ``` + ``` System.Collections.Generic.List`1 - ``` + ``` - The property in the object for ``System.Collections.Generic.List`1`` returns the following: - ``` + ``` 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 ("+"). diff --git a/xml/System.Collections.Concurrent/BlockingCollection`1.xml b/xml/System.Collections.Concurrent/BlockingCollection`1.xml index c4cb146903c..1c039f820ec 100644 --- a/xml/System.Collections.Concurrent/BlockingCollection`1.xml +++ b/xml/System.Collections.Concurrent/BlockingCollection`1.xml @@ -96,7 +96,7 @@ - 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 . @@ -864,7 +864,7 @@ 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.DataAnnotations/DisplayColumnAttribute.xml b/xml/System.ComponentModel.DataAnnotations/DisplayColumnAttribute.xml index 91f486f2e4b..ea4993b535c 100644 --- a/xml/System.ComponentModel.DataAnnotations/DisplayColumnAttribute.xml +++ b/xml/System.ComponentModel.DataAnnotations/DisplayColumnAttribute.xml @@ -68,11 +68,11 @@ - Applies the attribute to the `Address` metadata partial class to specify the following: - - The City column from the Address table (the parent table) is displayed as the foreign-key column in the CustomerAddress child table. + - The City column from the Address table (the parent table) is displayed as the foreign-key column in the CustomerAddress child table. - - The PostalCode column from the Address table (the parent table) is used for sorting the Address selection box in the CustomerAddress child table. + - The PostalCode column from the Address table (the parent table) is used for sorting the Address selection box in the CustomerAddress child table. - - The sort order is set to ascending. + - The sort order is set to ascending. The example applies the attribute to the `Customer` metadata partial class to specify that the LastName column in displayed as the foreign-key column for the CustomerAddress table. diff --git a/xml/System.ComponentModel.DataAnnotations/DisplayFormatAttribute.xml b/xml/System.ComponentModel.DataAnnotations/DisplayFormatAttribute.xml index 4b59d8642e0..3066257af81 100644 --- a/xml/System.ComponentModel.DataAnnotations/DisplayFormatAttribute.xml +++ b/xml/System.ComponentModel.DataAnnotations/DisplayFormatAttribute.xml @@ -60,9 +60,9 @@ The following example shows how to use the attribute to specify the following results: - - Display the text "[Null]" when a data field is empty. - - Display currency data in locale specific currency format. - - Display date information in short format (mm/dd/yy). This format also applies in edit mode. + - Display the text "[Null]" when a data field is empty. + - Display currency data in locale specific currency format. + - Display date information in short format (mm/dd/yy). This format also applies in edit mode. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.ComponentModel.DataAnnotations.DisplayFormatAttribute/CS/product.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.ComponentModel.DataAnnotations.DisplayFormatAttribute/VB/product.vb" id="Snippet1"::: diff --git a/xml/System.ComponentModel.DataAnnotations/RangeAttribute.xml b/xml/System.ComponentModel.DataAnnotations/RangeAttribute.xml index a389edbcc9d..e6306d20b55 100644 --- a/xml/System.ComponentModel.DataAnnotations/RangeAttribute.xml +++ b/xml/System.ComponentModel.DataAnnotations/RangeAttribute.xml @@ -59,11 +59,11 @@ - In the associated metadata class, it applies the attribute to obtain the following results: - - Apply the attribute to a data field of type integer. + - Apply the attribute to a data field of type integer. - - Apply the attribute to an integer data field and define a custom validation error message. + - Apply the attribute to an integer data field and define a custom validation error message. - - Apply the attribute to a `DateTime` data field and define a custom validation error message. + - Apply the attribute to a `DateTime` data field and define a custom validation error message. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.ComponentModel.DataAnnotations.RangeAttribute/CS/Product.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.ComponentModel.DataAnnotations.RangeAttribute/VB/Product.vb" id="Snippet1"::: diff --git a/xml/System.ComponentModel.DataAnnotations/RequiredAttribute.xml b/xml/System.ComponentModel.DataAnnotations/RequiredAttribute.xml index 665d7a9b3c3..3f5154f49d5 100644 --- a/xml/System.ComponentModel.DataAnnotations/RequiredAttribute.xml +++ b/xml/System.ComponentModel.DataAnnotations/RequiredAttribute.xml @@ -58,9 +58,9 @@ - In the associated metadata class, it applies the attribute, which specifies the following requirements: - - The Title data field cannot be empty. If validation fails, the code in the example throws a validation exception and displays an error message. The error message is specified at the time that the attribute is applied to the data field. + - The Title data field cannot be empty. If validation fails, the code in the example throws a validation exception and displays an error message. The error message is specified at the time that the attribute is applied to the data field. - - The MiddleName data field cannot be empty. If validation fails, the code in the example throws a validation exception and displays an error message. + - The MiddleName data field cannot be empty. If validation fails, the code in the example throws a validation exception and displays an error message. :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.ComponentModel.DataAnnotations.RequiredAttribute/CS/Customer.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.ComponentModel.DataAnnotations.RequiredAttribute/VB/Customer.vb" id="Snippet1"::: diff --git a/xml/System.ComponentModel/BindingList`1.xml b/xml/System.ComponentModel/BindingList`1.xml index 6a2dbeece8a..024ff60a2c0 100644 --- a/xml/System.ComponentModel/BindingList`1.xml +++ b/xml/System.ComponentModel/BindingList`1.xml @@ -99,8 +99,6 @@ 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. @@ -173,14 +171,12 @@ ## Remarks 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`| - - +| Property | Initial Value | +|--------------------------------------------------------------------|---------------| +| | `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. @@ -302,8 +298,6 @@ 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. @@ -362,24 +356,21 @@ ## Remarks 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. + 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. - Otherwise, the new item is automatically created through its public parameterless constructor. + Otherwise, the new item is automatically created through its public parameterless constructor. -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: +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 implicitly committed by some other operation that changed the contents of the list, such as an insertion or removal of an item. + - 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. 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. diff --git a/xml/System.Configuration/ConfigurationCollectionAttribute.xml b/xml/System.Configuration/ConfigurationCollectionAttribute.xml index 2a8b3e2cd10..3262c2ea72e 100644 --- a/xml/System.Configuration/ConfigurationCollectionAttribute.xml +++ b/xml/System.Configuration/ConfigurationCollectionAttribute.xml @@ -51,21 +51,21 @@ - The attributes that instruct .NET how to create instances of the custom configuration element properties. These types include: - - + - - - + - - The attributes that instruct .NET how to validate the custom configuration element properties. These types include: - - + - - - + - - - + - - - + - - - + - ## Examples The following example shows how to use the . diff --git a/xml/System.Configuration/ConfigurationPropertyAttribute.xml b/xml/System.Configuration/ConfigurationPropertyAttribute.xml index 1ae43cd7715..f6351f8822a 100644 --- a/xml/System.Configuration/ConfigurationPropertyAttribute.xml +++ b/xml/System.Configuration/ConfigurationPropertyAttribute.xml @@ -49,23 +49,23 @@ The .NET configuration system provides attribute types that you can use during the creation of custom configuration elements. There are two kinds of attribute types: -1. The types instructing .NET how to instantiate the custom configuration-element properties. These types include: +1. The types instructing .NET how to instantiate the custom configuration-element properties. These types include: - - + - - - + - -2. The types instructing .NET how to validate the custom configuration-element properties. These types include: +2. The types instructing .NET how to validate the custom configuration-element properties. These types include: - - + - - - + - - - + - - - + - - - + - diff --git a/xml/System.Configuration/ConfigurationSection.xml b/xml/System.Configuration/ConfigurationSection.xml index 7e413864c15..a1aa5ead9ec 100644 --- a/xml/System.Configuration/ConfigurationSection.xml +++ b/xml/System.Configuration/ConfigurationSection.xml @@ -75,21 +75,19 @@ - Reading. You use or to read configuration information. Note that the user or process that reads must have the following permissions: - - Read permission on the configuration file at the current configuration hierarchy level. + - Read permission on the configuration file at the current configuration hierarchy level. + - Read permissions on all the parent configuration files. - - Read permissions on all the parent configuration files. + If your application needs read-only access to its own configuration, it is recommended you use the overloaded methods in the case of Web applications, or the method in the case of client applications. - If your application needs read-only access to its own configuration, it is recommended you use the overloaded methods in the case of Web applications, or the method in the case of client applications. - - These methods provide access to the cached configuration values for the current application, which has better performance than the class. + These methods provide access to the cached configuration values for the current application, which has better performance than the class. Note: If you use a static method that takes a parameter, the parameter must refer to the application in which the code is running; otherwise, the parameter is ignored and configuration information for the currently-running application is returned. - Writing. You use one of the methods to write configuration information. Note that the user or process that writes must have the following permissions: - - Write permission on the configuration file and directory at the current configuration hierarchy level. - - - Read permissions on all the configuration files. + - Write permission on the configuration file and directory at the current configuration hierarchy level. + - Read permissions on all the configuration files. @@ -129,8 +127,6 @@ 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. - - ## 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. @@ -235,8 +231,6 @@ Note: If you use a static method that takes a simply returns the object that represents the from which it is called. - - ## Examples The following example shows how to use the method. diff --git a/xml/System.Diagnostics.Contracts/Contract.xml b/xml/System.Diagnostics.Contracts/Contract.xml index f9167cef0c9..3f241803ac6 100644 --- a/xml/System.Diagnostics.Contracts/Contract.xml +++ b/xml/System.Diagnostics.Contracts/Contract.xml @@ -58,7 +58,7 @@ For tools and detailed instructions for using code contracts, see [Code Contracts](https://marketplace.visualstudio.com/items?itemName=RiSEResearchinSoftwareEngineering.CodeContractsforNET) on the Visual Studio Marketplace. > [!IMPORTANT] -> You must use a binary rewriter to insert run-time enforcement of contracts. Otherwise, contracts such as the method can only be tested statically and will not throw exceptions during run time if a contract is violated. You can download the binary rewriter CCRewrite from [Code Contracts](https://marketplace.visualstudio.com/items?itemName=RiSEResearchinSoftwareEngineering.CodeContractsforNET) on the Visual Studio Marketplace. CCRewrite comes with a Visual Studio add-in that enables you to activate run-time contract enforcement from the project **Properties** page. The binary rewriter and the Visual Studio add-in do not ship with Visual Studio 2010 or the Windows SDK. +> You must use a binary rewriter to insert run-time enforcement of contracts. Otherwise, contracts such as the method can only be tested statically and will not throw exceptions during run time if a contract is violated. You can download the binary rewriter CCRewrite from [Code Contracts](https://marketplace.visualstudio.com/items?itemName=RiSEResearchinSoftwareEngineering.CodeContractsforNET) on the Visual Studio Marketplace. CCRewrite comes with a Visual Studio add-in that enables you to activate run-time contract enforcement from the project **Properties** page. The binary rewriter and the Visual Studio add-in do not ship with Visual Studio 2010 or the Windows SDK. ]]> @@ -282,7 +282,7 @@ method. + At runtime, using this method is equivalent to using the method. ]]> @@ -354,7 +354,7 @@ ## Remarks If `userMessage` is not a constant string literal, the contract may not be understood by tools. - At run time, using this method is equivalent to using the method. + At runtime, using this method is equivalent to using the method. ]]> @@ -536,8 +536,6 @@ - You must use the binary rewriter (available at [Code Contracts](https://marketplace.visualstudio.com/items?itemName=RiSEResearchinSoftwareEngineering.CodeContractsforNET) on the Visual Studio Marketplace) for run-time enforcement of this postcondition. - - ## Examples The following example shows how to use the method to ensure that an expected value is returned. This code example is part of a larger example provided for the class. @@ -604,11 +602,8 @@ The `condition` parameter specifies a postcondition that is expected to be `true` when the enclosing method or property returns normally. - This method call must be at the beginning of a method or property, before any other code. - - This contract is exposed to clients; therefore, it must only reference members that are at least as visible as the enclosing method. - - You must use the binary rewriter (available at [Code Contracts](https://marketplace.visualstudio.com/items?itemName=RiSEResearchinSoftwareEngineering.CodeContractsforNET) on the Visual Studio Marketplace) for run-time enforcement of this postcondition. - - If `userMessage` is not a constant string literal, the contract may not be understood by tools. ]]> @@ -952,8 +947,6 @@ ## Remarks The `toExclusive` parameter is one more than the last integer to facilitate using the length of a range of integers starting at 0. For example, it would be set to 5 for integers 0 through 4. - - ## Examples The following example demonstrates how to use the method to determine whether an array has a null element. @@ -1241,8 +1234,6 @@ ## Remarks This method can be used only in the conditional expression for the contract. - - ## Examples The following example shows the use of the method to ensure that a count has been updated. This code example is part of a larger example provided for the class. @@ -1442,7 +1433,7 @@ ## Remarks > [!IMPORTANT] -> You must turn on run-time checking to use the method. If run-time checking is turned off, the process will be terminated. To obtain the tools for runtime checking, see [Code Contracts](https://marketplace.visualstudio.com/items?itemName=RiSEResearchinSoftwareEngineering.CodeContractsforNET) on the Visual Studio Marketplace. +> You must turn on run-time checking to use the method. If run-time checking is turned off, the process will be terminated. To obtain the tools for runtime checking, see [Code Contracts](https://marketplace.visualstudio.com/items?itemName=RiSEResearchinSoftwareEngineering.CodeContractsforNET) on the Visual Studio Marketplace. - This method call must be at the beginning of a method or property, before any other code. @@ -1517,10 +1508,10 @@ ## Remarks -- > [!IMPORTANT] - > You must turn on run-time checking to use the method. If run-time checking is turned off, the process will be terminated. To obtain the tools for runtime checking, see [Code Contracts](https://marketplace.visualstudio.com/items?itemName=RiSEResearchinSoftwareEngineering.CodeContractsforNET) on the Visual Studio Marketplace. +> [!IMPORTANT] +> You must turn on run-time checking to use the method. If run-time checking is turned off, the process will be terminated. To obtain the tools for run-time checking, see [Code Contracts](https://marketplace.visualstudio.com/items?itemName=RiSEResearchinSoftwareEngineering.CodeContractsforNET) on the Visual Studio Marketplace. - This method call must be at the beginning of a method or property, before any other code. +This method call must be at the beginning of a method or property, before any other code. - This contract is exposed to clients; therefore, it must only reference members that are at least as visible as the enclosing method. @@ -1585,8 +1576,6 @@ ## Remarks This method can be used only in the conditional expression for the contract. - - ## Examples The following example shows how to use the method to specify an expected return value. This code example is part of a larger example provided for the class. diff --git a/xml/System.Diagnostics/Activity.xml b/xml/System.Diagnostics/Activity.xml index ab0bb0a76be..e86fd24a6d5 100644 --- a/xml/System.Diagnostics/Activity.xml +++ b/xml/System.Diagnostics/Activity.xml @@ -1853,13 +1853,15 @@ When passing code value different than ActivityStatusCode.Error, the Activity.St ## Remarks - - If the input value is `null`: - - If the collection has any tag with the same key, then this tag will get removed from the collection. - - Otherwise, nothing will happen and the collection will not change. + + - If the collection has any tag with the same key, then this tag will get removed from the collection. + - Otherwise, nothing will happen and the collection will not change. + - If the input value is not `null`: - - If the collection has any tag with the same key, then the value mapped to this key will get updated with the new input value. - - Otherwise, the key and value will get added as a new tag to the collection. + + - If the collection has any tag with the same key, then the value mapped to this key will get updated with the new input value. + - Otherwise, the key and value will get added as a new tag to the collection. ]]> diff --git a/xml/System.Diagnostics/ActivityTagsCollection.xml b/xml/System.Diagnostics/ActivityTagsCollection.xml index c8f3a912510..d2ea348e8fc 100644 --- a/xml/System.Diagnostics/ActivityTagsCollection.xml +++ b/xml/System.Diagnostics/ActivityTagsCollection.xml @@ -55,12 +55,15 @@ This collection will be used with classes like and . This collection behaves as follows: + - The collection items will be ordered according to how they are added. - Don't allow duplication of items with the same key. - When using the indexer to store an item in the collection: - - If the item has a key that previously existed in the collection and the value is , the collection item matching the key will be removed from the collection. - - If the item has a key that previously existed in the collection and the value is not , the new item value will replace the old value stored in the collection. - - Otherwise, the item will be added to the collection. + + - If the item has a key that previously existed in the collection and the value is , the collection item matching the key will be removed from the collection. + - If the item has a key that previously existed in the collection and the value is not , the new item value will replace the old value stored in the collection. + - Otherwise, the item will be added to the collection. + - Add method will add a new item to the collection if an item doesn't already exist with the same key. Otherwise, it will throw an exception. To be added. @@ -481,7 +484,7 @@ This collection behaves as follows: The key of the value to get or set. Gets or sets a specified collection item. - + When setting a value to this indexer property, the following behavior is observed: - If the key previously existed in the collection and the value is , the collection item matching the key will get removed from the collection. - If the key previously existed in the collection and the value is not , the value will replace the old value stored in the collection. diff --git a/xml/System.Diagnostics/ConditionalAttribute.xml b/xml/System.Diagnostics/ConditionalAttribute.xml index a2548e676ff..a557f8aef41 100644 --- a/xml/System.Diagnostics/ConditionalAttribute.xml +++ b/xml/System.Diagnostics/ConditionalAttribute.xml @@ -75,23 +75,23 @@ - Use pragmas in the source code; for example, define the compilation variable as follows: - ```csharp + ```csharp #define DEBUG - ``` + ``` - ```vb + ```vb #Const DEBUG=True - ``` + ``` - To undefine the variable, use the following: + To undefine the variable, use the following: - ```csharp + ```csharp #undef DEBUG - ``` + ``` - ```vb + ```vb #Const DEBUG=False - ``` + ``` Compilers that comply with the Common Language Specification (CLS) are permitted to ignore . The C#, F#, Visual Basic, and C++ compilers support ; the JScript compiler does not support the attribute. diff --git a/xml/System.DirectoryServices/DirectorySearcher.xml b/xml/System.DirectoryServices/DirectorySearcher.xml index 5735df56fd7..390bee82ad6 100644 --- a/xml/System.DirectoryServices/DirectorySearcher.xml +++ b/xml/System.DirectoryServices/DirectorySearcher.xml @@ -1159,13 +1159,13 @@ SearchResultCollection res = src.FindAll(); - The following C# code shows how to enumerate the global catalog and pick the first child. - ```csharp + ```csharp DirectoryEntry entry = new DirectoryEntry("GC://forestname"); IEnumerator ie = entry.Children.GetEnumerator(); ie.MoveNext(); entry = (DirectoryEntry)ie.Current; DirectorySearcher search = new DirectorySearcher(entry); - ``` + ``` ]]> diff --git a/xml/System.Globalization/CultureInfo.xml b/xml/System.Globalization/CultureInfo.xml index 80035b007e6..eb76fa10f4b 100644 --- a/xml/System.Globalization/CultureInfo.xml +++ b/xml/System.Globalization/CultureInfo.xml @@ -2372,8 +2372,8 @@ Setting `predefinedOnly` to `true` will ensure a culture is created only if the - , which returns all custom cultures, such as those registered by the class. In versions of Windows before Windows 10, the value applies to all user-defined custom cultures. Starting with Windows 10, it applies to system cultures that lack complete cultural data and that do not have a unique local identifier, as indicated by the property value. As a result, code such as the following will return different results when run on Windows 10 and on an earlier version of Windows. - :::code language="csharp" source="~/snippets/csharp/System.Globalization/CultureInfo/DisplayName/getcultures3.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CultureInfo/DisplayName/getcultures3.vb" id="Snippet2"::: + :::code language="csharp" source="~/snippets/csharp/System.Globalization/CultureInfo/DisplayName/getcultures3.cs" id="Snippet2"::: + :::code language="vb" source="~/snippets/visualbasic/System.Globalization/CultureInfo/DisplayName/getcultures3.vb" id="Snippet2"::: ## Examples The following code example displays several properties of the neutral cultures. diff --git a/xml/System.IO.Packaging/Package.xml b/xml/System.IO.Packaging/Package.xml index ad4a2a709d0..e52027aa309 100644 --- a/xml/System.IO.Packaging/Package.xml +++ b/xml/System.IO.Packaging/Package.xml @@ -70,13 +70,13 @@ - A package-level relationship (created by the method) relates a to either: - - A target part in the package. - - A target resource outside the package. + - A target part in the package. + - A target resource outside the package. - A part-level relationship (created by the method) relates a source to either: - - Another target part in the package. - - A target resource outside the package. + - Another target part in the package. + - A target resource outside the package. The relationship's source or source is considered the "owner" of the relationship. When the source object is deleted, all the relationships owned by the source object are also deleted. The process of creating or deleting a relationship does not physically change either the source or target objects in any way. diff --git a/xml/System.Linq.Expressions/Expression.xml b/xml/System.Linq.Expressions/Expression.xml index afb05ada36c..1f672037282 100644 --- a/xml/System.Linq.Expressions/Expression.xml +++ b/xml/System.Linq.Expressions/Expression.xml @@ -875,9 +875,9 @@ If the implementing method is `null`: - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: @@ -971,9 +971,9 @@ If the implementing method is `null`: - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: @@ -1070,9 +1070,9 @@ If the implementing method is `null`: - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: @@ -1174,9 +1174,9 @@ If the implementing method is `null`: - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: @@ -1276,13 +1276,13 @@ If the implementing method is `null`: - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable, and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable, and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: -- `left`.Type and `right`.Type are the same Boolean type. +- `left`.Type and `right`.Type are the same Boolean type. - If `left`.Type and `right`.Type are non-nullable, the node is not lifted. The type of the node is the result type of the predefined conditional `AND` operator. @@ -1389,13 +1389,13 @@ If the implementing method is `null`: - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable, and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable, and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: -- `left`.Type and `right`.Type are the same Boolean type. +- `left`.Type and `right`.Type are the same Boolean type. - If `left`.Type and `right`.Type are non-nullable, the node is not lifted. The type of the node is the result type of the predefined conditional `AND` operator. @@ -5234,9 +5234,9 @@ If the implementing method is `null`: - Otherwise: - - If both `expression`.Type and `type` represent numeric or Boolean types, or nullable or non-nullable enumeration types, the implementing method is `null`. + - If both `expression`.Type and `type` represent numeric or Boolean types, or nullable or non-nullable enumeration types, the implementing method is `null`. - - If either `expression`.Type or `type` is a reference type and an explicit boxing, unboxing, or reference conversion exists from `expression`.Type to `type`, the implementing method is `null`. + - If either `expression`.Type or `type` is a reference type and an explicit boxing, unboxing, or reference conversion exists from `expression`.Type to `type`, the implementing method is `null`. #### Lifted versus Non-Lifted If the implementing method is not `null`: @@ -5336,9 +5336,9 @@ If the implementing method is `null`: - Otherwise: - - If both `expression`.Type and `type` represent numeric or Boolean types, or nullable or non-nullable enumeration types, the implementing method is `null`. + - If both `expression`.Type and `type` represent numeric or Boolean types, or nullable or non-nullable enumeration types, the implementing method is `null`. - - If either `expression`.Type or `type` is a reference type and an explicit boxing, unboxing, or reference conversion exists from `expression`.Type to `type`, the implementing method is `null`. + - If either `expression`.Type or `type` is a reference type and an explicit boxing, unboxing, or reference conversion exists from `expression`.Type to `type`, the implementing method is `null`. #### Lifted versus Non-Lifted If the implementing method is not `null`: @@ -5445,9 +5445,9 @@ If the implementing method is `null`: - Otherwise: - - If both `expression`.Type and `type` represent numeric or Boolean types, or nullable or non-nullable enumeration types, the implementing method is `null`. + - If both `expression`.Type and `type` represent numeric or Boolean types, or nullable or non-nullable enumeration types, the implementing method is `null`. - - If either `expression`.Type or `type` is a reference type and an explicit boxing, unboxing, or reference conversion exists from `expression`.Type to `type`, the implementing method is `null`. + - If either `expression`.Type or `type` is a reference type and an explicit boxing, unboxing, or reference conversion exists from `expression`.Type to `type`, the implementing method is `null`. #### Lifted versus Non-Lifted If the implementing method is not `null`: @@ -5539,9 +5539,9 @@ If the implementing method is `null`: - Otherwise: - - If both `expression`.Type and `type` represent numeric or Boolean types, or nullable or non-nullable enumeration types, the implementing method is `null`. + - If both `expression`.Type and `type` represent numeric or Boolean types, or nullable or non-nullable enumeration types, the implementing method is `null`. - - If either `expression`.Type or `type` is a reference type and an explicit boxing, unboxing, or reference conversion exists from `expression`.Type to `type`, the implementing method is `null`. + - If either `expression`.Type or `type` is a reference type and an explicit boxing, unboxing, or reference conversion exists from `expression`.Type to `type`, the implementing method is `null`. #### Lifted versus Non-Lifted If the implementing method is not `null`: @@ -5899,9 +5899,9 @@ If the implementing method is `null`: - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: @@ -6003,9 +6003,9 @@ If the implementing method is `null`: - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: @@ -6915,9 +6915,9 @@ If the implementing method is `null`: - If the following two conditions are satisfied, the node is lifted and the type of the node is : - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is . + - The return type of the implementing method is . If the implementing method is `null`: @@ -7020,9 +7020,9 @@ If the implementing method is `null`: - If the following two conditions are satisfied, the node is lifted; also, the type of the node is nullable if `liftToNull` is `true` or if `liftToNull` is `false`: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is . + - The return type of the implementing method is . If the implementing method is `null`: @@ -7119,9 +7119,9 @@ If the implementing method is `null`: - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: @@ -7223,9 +7223,9 @@ If the implementing method is `null`: - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: @@ -8172,9 +8172,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is : - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is . + - The return type of the implementing method is . If the implementing method is `null`: @@ -8279,9 +8279,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted; also, the type of the node is nullable if `liftToNull` is `true` or if `liftToNull` is `false`: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is . + - The return type of the implementing method is . If the implementing method is `null`: @@ -8378,9 +8378,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is : - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is . + - The return type of the implementing method is . If the implementing method is `null`: @@ -8485,9 +8485,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted; also, the type of the node is nullable if `liftToNull` is `true` or if `liftToNull` is `false`: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is . + - The return type of the implementing method is . If the implementing method is `null`: @@ -10945,9 +10945,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: @@ -11041,9 +11041,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: @@ -11322,9 +11322,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is : - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is . + - The return type of the implementing method is . If the implementing method is `null`: @@ -11429,9 +11429,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted; also, the type of the node is nullable if `liftToNull` is `true` or if `liftToNull` is `false`: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is . + - The return type of the implementing method is . If the implementing method is `null`: @@ -11528,9 +11528,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is : - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is . + - The return type of the implementing method is . If the implementing method is `null`: @@ -11635,9 +11635,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted; also, the type of the node is nullable if `liftToNull` is `true` or if `liftToNull` is `false`: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is . + - The return type of the implementing method is . If the implementing method is `null`: @@ -14271,9 +14271,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: @@ -14367,9 +14367,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: @@ -14648,9 +14648,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: @@ -14752,9 +14752,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: @@ -15215,9 +15215,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: @@ -15311,9 +15311,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: @@ -15406,9 +15406,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `expression`.Type is a nullable value type and the corresponding non-nullable value type is equal to the argument type of the implementing method. + - `expression`.Type is a nullable value type and the corresponding non-nullable value type is equal to the argument type of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`, the type of the node is `expression`.Type. If `expression`.Type is non-nullable, the node is not lifted. Otherwise, the node is lifted. @@ -15502,9 +15502,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `expression`.Type is a nullable value type and the corresponding non-nullable value type is equal to the argument type of the implementing method. + - `expression`.Type is a nullable value type and the corresponding non-nullable value type is equal to the argument type of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`, the type of the node is `expression`.Type. If `expression`.Type is non-nullable, the node is not lifted. Otherwise, the node is lifted. @@ -15597,9 +15597,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `expression`.Type is a nullable value type and the corresponding non-nullable value type is equal to the argument type of the implementing method. + - `expression`.Type is a nullable value type and the corresponding non-nullable value type is equal to the argument type of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`, the type of the node is `expression`.Type. If `expression`.Type is non-nullable, the node is not lifted. Otherwise, the node is lifted. @@ -15685,9 +15685,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `expression`.Type is a nullable value type and the corresponding non-nullable value type is equal to the argument type of the implementing method. + - `expression`.Type is a nullable value type and the corresponding non-nullable value type is equal to the argument type of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`, the type of the node is `expression`.Type. If `expression`.Type is non-nullable, the node is not lifted. Otherwise, the node is lifted. @@ -16698,9 +16698,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `expression`.Type is a nullable value type and the corresponding non-nullable type is equal to the argument type of the implementing method. + - `expression`.Type is a nullable value type and the corresponding non-nullable type is equal to the argument type of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`, the type of the node is `expression`.Type. If `expression`.Type is non-nullable, the node is not lifted. Otherwise, the node is lifted. @@ -16794,9 +16794,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `expression`.Type is a nullable value type and the corresponding non-nullable value type is equal to the argument type of the implementing method. + - `expression`.Type is a nullable value type and the corresponding non-nullable value type is equal to the argument type of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`, the type of the node is `expression`.Type. If `expression`.Type is non-nullable, the node is not lifted. Otherwise, the node is lifted. @@ -16893,9 +16893,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is : - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is . + - The return type of the implementing method is . If the implementing method is `null`: @@ -16992,9 +16992,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted; also, the type of the node is nullable if `liftToNull` is `true` or if `liftToNull` is `false`: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is . + - The return type of the implementing method is . If the implementing method is `null`: @@ -17203,9 +17203,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: @@ -17307,9 +17307,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: @@ -17591,13 +17591,13 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable, and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable, and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: -- `left`.Type and `right`.Type are the same Boolean type. +- `left`.Type and `right`.Type are the same Boolean type. - If `left`.Type and `right`.Type are non-nullable, the node is not lifted. The type of the node is the result type of the predefined conditional `OR` operator. @@ -17704,13 +17704,13 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable, and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable, and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: -- `left`.Type and `right`.Type are the same Boolean type. +- `left`.Type and `right`.Type are the same Boolean type. - If `left`.Type and `right`.Type are non-nullable, the node is not lifted. The type of the node is the result type of the predefined conditional `OR` operator. @@ -18157,9 +18157,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. ]]> @@ -18250,9 +18250,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. ]]> @@ -19939,9 +19939,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: @@ -20035,9 +20035,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: @@ -20425,9 +20425,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: @@ -20529,9 +20529,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: @@ -20992,9 +20992,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: @@ -21088,9 +21088,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. + - `left`.Type and `right`.Type are both value types of which at least one is nullable and the corresponding non-nullable types are equal to the corresponding argument types of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`: @@ -22787,9 +22787,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `expression`.Type is a nullable value type and the corresponding non-nullable value type is equal to the argument type of the implementing method. + - `expression`.Type is a nullable value type and the corresponding non-nullable value type is equal to the argument type of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`, the type of the node is `expression`.Type. If `expression`.Type is non-nullable, the node is not lifted. Otherwise, the node is lifted. @@ -22875,9 +22875,9 @@ As with `Func`, the last argument is the return type. It can be set to `System.V - If the following two conditions are satisfied, the node is lifted and the type of the node is the nullable type that corresponds to the return type of the implementing method: - - `expression`.Type is a nullable value type and the corresponding non-nullable value type is equal to the argument type of the implementing method. + - `expression`.Type is a nullable value type and the corresponding non-nullable value type is equal to the argument type of the implementing method. - - The return type of the implementing method is a non-nullable value type. + - The return type of the implementing method is a non-nullable value type. If the implementing method is `null`, the type of the node is `expression`.Type. If `expression`.Type is non-nullable, the node is not lifted. Otherwise, the node is lifted. diff --git a/xml/System.Printing/PrintCapabilities.xml b/xml/System.Printing/PrintCapabilities.xml index 29ae0cc927c..58d7b95832f 100644 --- a/xml/System.Printing/PrintCapabilities.xml +++ b/xml/System.Printing/PrintCapabilities.xml @@ -36,12 +36,10 @@ **Note** When the object is created with the constructor that takes a PrintCapabilities document (as a ) parameter, that entire document is stored in a non-public field in the object, including the XML elements within it that express less common features that are not represented by any of the public properties of the class. In fact, if the driver that produced the PrintCapabilities document is using a private extension of the [Print Schema](https://learn.microsoft.com/windows/win32/printdocs/printschema), that privately defined markup is also stored as part of the non-public PrintCapabilities document. > [!CAUTION] -> Classes within the namespace are not supported for use within a Windows service or ASP.NET application or service. Attempting to use these classes from within one of these application types may produce unexpected problems, such as diminished service performance and run-time exceptions. +> Classes within the namespace are not supported for use within a Windows service or ASP.NET application or service. Attempting to use these classes from within one of these application types may produce unexpected problems, such as diminished service performance and run-time exceptions. If you want to print from a Windows Forms application, see the namespace. - - ## Examples The following example shows how to determine the capabilities of a specific printer and how to configure a print job to take advantage of them. @@ -131,8 +129,6 @@ This property corresponds to the [Print Schema](https://learn.microsoft.com/windows/win32/printdocs/printschema)'s `DocumentCollate` keyword, not the `JobCollateAllDocuments` keyword. - - ## Examples The following example shows how to use this property to determine the capabilities of a specific printer and how to configure a print job to take advantage of them. @@ -214,8 +210,6 @@ This property corresponds to the [Print Schema](https://learn.microsoft.com/windows/win32/printdocs/printschema)'s `JobDuplexAllDocumentsContiguously` keyword, not the `DocumentDuplex` keyword. - - ## Examples The following example shows how to use this property to determine the capabilities of a specific printer and how to configure a print job to take advantage of them. @@ -558,8 +552,6 @@ This property corresponds to the [Print Schema](https://learn.microsoft.com/windows/win32/printdocs/printschema)'s `PageMediaSize` keyword. - - ## Examples The following code example shows how to search for a particular value in the . @@ -726,8 +718,6 @@ foreach (PageMediaSize mediaSize in pc.PageMediaSizeCapability) This property corresponds to the [Print Schema](https://learn.microsoft.com/windows/win32/printdocs/printschema)'s `PageResolution` keyword. - - ## Examples The following code example shows how to search for a particular value in the . @@ -781,21 +771,21 @@ foreach (PageResolution pageRes in pc.PageResolutionCapability) - In all other cases, the property's behavior is as follows. - The property of the property's object is the smallest of the following values. + The property of the property's object is the smallest of the following values. - - The **MinValue** property of the `PageScalingScaleWidth` datatype that provides the value of the **Custom** option's **ScaleWidth** `ScoredProperty`. + - The **MinValue** property of the `PageScalingScaleWidth` datatype that provides the value of the **Custom** option's **ScaleWidth** `ScoredProperty`. - - The **MinValue** property of the `PageScalingScaleHeight` datatype that provides the value of the **Custom** option's **ScaleHeight** `ScoredProperty`. + - The **MinValue** property of the `PageScalingScaleHeight` datatype that provides the value of the **Custom** option's **ScaleHeight** `ScoredProperty`. - - The **MinValue** property of the `PageScalingScale` datatype that provides the value of the **CustomSquare** option's **Scale** `ScoredProperty`. + - The **MinValue** property of the `PageScalingScale` datatype that provides the value of the **CustomSquare** option's **Scale** `ScoredProperty`. - The property of the property's object is the largest of the following values. + The property of the property's object is the largest of the following values. - - The **MaxValue** property of the `PageScalingScaleWidth` datatype that provides the value of the **Custom** option's **ScaleWidth** `ScoredProperty`. + - The **MaxValue** property of the `PageScalingScaleWidth` datatype that provides the value of the **Custom** option's **ScaleWidth** `ScoredProperty`. - - The **MaxValue** property of the `PageScalingScaleHeight` datatype that provides the value of the **Custom** option's **ScaleHeight** `ScoredProperty`. + - The **MaxValue** property of the `PageScalingScaleHeight` datatype that provides the value of the **Custom** option's **ScaleHeight** `ScoredProperty`. - - The **MaxValue** property of the `PageScalingScale` datatype that provides the value of the **CustomSquare** option's **Scale** `ScoredProperty`. + - The **MaxValue** property of the `PageScalingScale` datatype that provides the value of the **CustomSquare** option's **Scale** `ScoredProperty`. ]]> diff --git a/xml/System.Reflection/ModuleResolveEventHandler.xml b/xml/System.Reflection/ModuleResolveEventHandler.xml index 6bff7a3d96a..037663788bc 100644 --- a/xml/System.Reflection/ModuleResolveEventHandler.xml +++ b/xml/System.Reflection/ModuleResolveEventHandler.xml @@ -66,20 +66,21 @@ To compile and run the example: 1. Compile Server1 using the following command: - ```console - csc /out:subfolder\Server1.netmodule /t:module Server1.cs - ``` + ```console + csc /out:subfolder\Server1.netmodule /t:module Server1.cs + ``` 1. Compile MySample using the following command: - ```console - csc /out:MySample.exe /t:exe /addmodule:subfolder\Server1.netmodule MySample.cs - ``` + ```console + csc /out:MySample.exe /t:exe /addmodule:subfolder\Server1.netmodule MySample.cs + ``` 1. Run MySample.exe. > [!NOTE] > The module file Server1.netmodule must be in a subdirectory named "subfolder" for this example to work properly. + ]]> diff --git a/xml/System.Resources/ResourceReader.xml b/xml/System.Resources/ResourceReader.xml index 400080978cc..e54779893d1 100644 --- a/xml/System.Resources/ResourceReader.xml +++ b/xml/System.Resources/ResourceReader.xml @@ -182,9 +182,9 @@ The following example illustrates how to use this approach to retrieve resources The source code file is named CreateResources.cs. You can compile it in C# by using the following command: - ``` - csc CreateResources.cs /r:library.dll - ``` + ``` + csc CreateResources.cs /r:library.dll + ``` 2. Compile and run the following code to enumerate the resources in the ContactResources.resources file. @@ -590,17 +590,17 @@ Label11="Mobile Phone:" The implementation of the property by the class can throw the following exceptions: -- +- - The assembly that contains the type to which the data belongs cannot be found. + The assembly that contains the type to which the data belongs cannot be found. -- +- - The data is not in the expected format. + The data is not in the expected format. -- +- - The type to which the data belongs cannot be found. + The type to which the data belongs cannot be found. You can handle the exception by calling the method to retrieve information about the data type and the byte array assigned to the named resource. For more information, see the "Retrieving Resources by Name with GetResourceData" section in the class topic. @@ -696,23 +696,24 @@ Label11="Mobile Phone:" method retrieves the value of a named resource as a byte array. It is typically used when the property throws an exception when it tries to retrieve the value of a resource. - `resourceType` is a string that represents the data type of the resource. It can be any of the following values: +The method retrieves the value of a named resource as a byte array. It is typically used when the property throws an exception when it tries to retrieve the value of a resource. - - The string representation of a `ResourceTypeCode` enumeration member that indicates the data type of the resource. `ResourceTypeCode` is a private enumeration that is used by Resgen.exe to indicate that a special binary format is used to store one of 19 common data types. These include the .NET primitive data types (, , , , , , , , , , , , ), as well as , , and . In addition, the `ResourceTypeCode` enumeration includes the values shown in the following table. +`resourceType` is a string that represents the data type of the resource. It can be any of the following values: - |ResourceTypeCode value|Description| - |----------------------------|-----------------| - |`ResourceTypeCode.ByteArray`|The data is a byte array. This data type commonly results from the call to the method.| - |`ResourceTypeCode.Null`|The data is a null reference. This data type commonly results from the call to the method with an object whose value is `null`.| - |`ResourceTypeCode.Stream`|The data is stored in a stream. This data type commonly results from the call to the or method.| +- The string representation of a `ResourceTypeCode` enumeration member that indicates the data type of the resource. `ResourceTypeCode` is a private enumeration that is used by Resgen.exe to indicate that a special binary format is used to store one of 19 common data types. These include the .NET primitive data types (, , , , , , , , , , , , ), as well as , , and . In addition, the `ResourceTypeCode` enumeration includes the values shown in the following table. - Assuming that `resourceData` has not been corrupted, it can usually be converted from a byte array back to its original value by calling a or method. + |ResourceTypeCode value|Description| + |----------------------------|-----------------| + |`ResourceTypeCode.ByteArray`|The data is a byte array. This data type commonly results from the call to the method.| + |`ResourceTypeCode.Null`|The data is a null reference. This data type commonly results from the call to the method with an object whose value is `null`.| + |`ResourceTypeCode.Stream`|The data is stored in a stream. This data type commonly results from the call to the or method.| + + Assuming that `resourceData` has not been corrupted, it can usually be converted from a byte array back to its original value by calling a or method. - A string that contains the fully qualified name of the type whose serialized data is assigned to the `resourceData` argument (for example, `System.String`). In addition, for types that are not part of the .NET class library, the string includes the name, version, culture, and public key of the assembly that contains the type. For example, the following string indicates that the serialized data represents an instance of the `Person` type in the `Extensions` namespace, which is found in version 1.0 of an assembly named Utility that has no public key and no designated culture. - `Extensions.Person, Utility, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null` + `Extensions.Person, Utility, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null` - The string used to describe the data type in the method call. diff --git a/xml/System.Resources/ResourceWriter.xml b/xml/System.Resources/ResourceWriter.xml index 1b0e1155672..db148d7eae5 100644 --- a/xml/System.Resources/ResourceWriter.xml +++ b/xml/System.Resources/ResourceWriter.xml @@ -698,15 +698,15 @@ - The string representation of a `ResourceTypeCode` enumeration member that indicates the data type of the resource. `ResourceTypeCode` is a private enumeration that is used by [Resgen.exe](/dotnet/framework/tools/resgen-exe-resource-file-generator) to indicate that a special binary format is used to store one of 19 common data types. These include the .NET primitive data types (, , , , , , , , , , , , ), as well as , , and . In addition, the `ResourceTypeCode` enumeration includes the values shown in the following table. - |`ResourceTypeCode` value|Description| - |------------------------------|-----------------| - |`ResourceTypeCode.ByteArray`|The data is a byte array.| - |`ResourceTypeCode.Null`|The data is a null reference.| - |`ResourceTypeCode.Stream`|The data is stored in a stream.| + |`ResourceTypeCode` value|Description| + |------------------------------|-----------------| + |`ResourceTypeCode.ByteArray`|The data is a byte array.| + |`ResourceTypeCode.Null`|The data is a null reference.| + |`ResourceTypeCode.Stream`|The data is stored in a stream.| - A string that contains the fully qualified name of the type whose binary data is assigned to the `serializedData` argument (for example, `System.String`). In addition, for types that are not part of the .NET class library, the string includes the name, version, culture, and public key of the assembly that contains the type. For example, the following string indicates that the serialized data represents an instance of the `Person` type in the `Extensions` namespace, which is found in version 1.0 of an assembly named Utility that has no public key and no designated culture. - `Extensions.Person, Utility, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null` + `Extensions.Person, Utility, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null` A parallel method for reading resource data written with the method is . diff --git a/xml/System.Runtime.Caching/ChangeMonitor.xml b/xml/System.Runtime.Caching/ChangeMonitor.xml index 634237cd932..199d56f80bd 100644 --- a/xml/System.Runtime.Caching/ChangeMonitor.xml +++ b/xml/System.Runtime.Caching/ChangeMonitor.xml @@ -40,10 +40,10 @@ .NET includes the following classes that derive from class: -- -- -- -- +- +- +- +- Each of these classes works with different types of dependencies. For example, the derived class monitors changes to a cache for file system data (files and folders) that the cache item depends on. @@ -71,21 +71,21 @@ - The method overload must be called to dispose of the instance. The rules for calling Dispose are as follows: - - Before an item is inserted into the cache, it is the responsibility of caller to dispose of a instance. + - Before an item is inserted into the cache, it is the responsibility of caller to dispose of a instance. - - Once cache item and the instances that are associated with it are passed to a cache, the cache implementer must make sure that the method is called, even if the insert fails. + - Once cache item and the instances that are associated with it are passed to a cache, the cache implementer must make sure that the method is called, even if the insert fails. - - After an item and its associated instances are passed to a cache, the caller must not dispose the dependency because when the method is called, the call is treated as if the dependency has changed. As a result, the method is automatically invoked. + - After an item and its associated instances are passed to a cache, the caller must not dispose the dependency because when the method is called, the call is treated as if the dependency has changed. As a result, the method is automatically invoked. - Taking these rules into consideration, the method must be called in one of the following ways: - - Users must call the method overload if they decide not to insert the derived change-monitor instance into a cache. + - Users must call the method overload if they decide not to insert the derived change-monitor instance into a cache. - - If the implementation tries to insert the change-monitor instance into an object cache but the insertion fails, the cache implementation is responsible for calling the overload. When the insertion attempt causes an exception, the cache implementation must dispose of any associated dependencies. + - If the implementation tries to insert the change-monitor instance into an object cache but the insertion fails, the cache implementation is responsible for calling the overload. When the insertion attempt causes an exception, the cache implementation must dispose of any associated dependencies. - - If the cache entry is removed, the cache implementation must also dispose of the dependency. + - If the cache entry is removed, the cache implementation must also dispose of the dependency. - - The internal implementation of the method automatically calls the method after it calls a callback that is registered through . + - The internal implementation of the method automatically calls the method after it calls a callback that is registered through . Note: This automatic call to the dispose method during the event firing only occurs if the initialization of the instance was previously completed. @@ -180,11 +180,11 @@ Note: This automatic call to the dispose method during the event firing only occ - Taking these rules into consideration, the method must be called in one of the following ways: - - Users must call the method overload if they decide not to insert the derived change-monitor instance into a cache. + - Users must call the method overload if they decide not to insert the derived change-monitor instance into a cache. - - The cache implementation is responsible for calling the overload if the implementation tries to insert the change-monitor instance into an object cache but the insertion fails. When the insertion attempt causes an exception, the cache implementation must dispose any associated dependencies. + - The cache implementation is responsible for calling the overload if the implementation tries to insert the change-monitor instance into an object cache but the insertion fails. When the insertion attempt causes an exception, the cache implementation must dispose any associated dependencies. - - If the cache entry is removed, the cache implementation must also dispose the dependency. + - If the cache entry is removed, the cache implementation must also dispose the dependency. The internal implementation of the method automatically calls the method after it calls a callback that is registered through the method. diff --git a/xml/System.Runtime.CompilerServices/InternalsVisibleToAttribute.xml b/xml/System.Runtime.CompilerServices/InternalsVisibleToAttribute.xml index ba5c1216f44..fc965833449 100644 --- a/xml/System.Runtime.CompilerServices/InternalsVisibleToAttribute.xml +++ b/xml/System.Runtime.CompilerServices/InternalsVisibleToAttribute.xml @@ -96,11 +96,11 @@ You can use the [Strong Name Tool (Sn.exe)](/dotnet/framework/tools/sn-exe-stron 1. Extract the public key from the strong-named key file to a separate file: - `Sn -p ` + `Sn -p ` 2. Display the full public key to the console: - `Sn -tp ` + `Sn -tp ` 3. Copy and paste the full public key value into your source code. @@ -196,21 +196,17 @@ The following example provides the source code for the `Friend2` assembly. Note You can use [Sn.exe (Strong Name Tool)](/dotnet/framework/tools/sn-exe-strong-name-tool) to retrieve the full public key from a strong-named key (.snk) file. To do this, you perform the following steps: -1. Extract the public key from the strong-named key file to a separate file: - - **Sn -p** *snk_file* *outfile* - -2. Display the full public key to the console: +1. Extract the public key from the strong-named key file to a separate file: - **Sn -tp** *outfile* + **Sn -p** *snk_file* *outfile* -3. Copy and paste the full public key value into your source code. +2. Display the full public key to the console: - For more information about how to use the attribute, see the following articles: + **Sn -tp** *outfile* -- [Friend Assemblies (C++)](/cpp/dotnet/friend-assemblies-cpp) +3. Copy and paste the full public key value into your source code. -- [Friend assemblies](/dotnet/standard/assembly/friend) + For more information about how to use the attribute, see [Friend assemblies](/dotnet/standard/assembly/friend). ## Examples **Signed assemblies** @@ -225,7 +221,7 @@ The following example provides the source code for the `Friend2` assembly. Note :::code language="csharp" source="~/snippets/csharp/System.Runtime.CompilerServices/InternalsVisibleToAttribute/Overview/Friend/friend1.cs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/System.Runtime.CompilerServices/InternalsVisibleToAttribute/Overview/Friend/friend1.vb" id="Snippet2"::: - The following example uses the attribute to make an `internal` member of an unsigned assembly visible to another unsigned assembly. The attribute ensures that the `internal` `StringLib.IsFirstLetterUpperCase` method in an assembly named `UtilityLib` is visible to the code in an assembly named `Friend2`. The following is the source code for UtilityLib.dll: + The following example uses the attribute to make an `internal` member of an unsigned assembly visible to another unsigned assembly. The attribute ensures that the `internal` `StringLib.IsFirstLetterUpperCase` method in an assembly named `UtilityLib` is visible to the code in an assembly named `Friend2`. The following is the source code for UtilityLib.dll: :::code language="csharp" source="~/snippets/csharp/System.Runtime.CompilerServices/InternalsVisibleToAttribute/Overview/UtilityLib/utilitylib.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/System.Runtime.CompilerServices/InternalsVisibleToAttribute/Overview/UtilityLib/utilitylib.vb" id="Snippet5"::: @@ -327,9 +323,9 @@ The following example provides the source code for the `Friend2` assembly. Note ## Remarks For more information about how to use the attribute, see the following topics: -- [Friend Assemblies (C++)](/cpp/dotnet/friend-assemblies-cpp) +- [Friend Assemblies (C++)](/cpp/dotnet/friend-assemblies-cpp) -- [Friend assemblies](/dotnet/standard/assembly/friend) +- [Friend assemblies](/dotnet/standard/assembly/friend) ]]> diff --git a/xml/System.Runtime.InteropServices/SEHException.xml b/xml/System.Runtime.InteropServices/SEHException.xml index 3a8e298e19a..b772da14190 100644 --- a/xml/System.Runtime.InteropServices/SEHException.xml +++ b/xml/System.Runtime.InteropServices/SEHException.xml @@ -74,10 +74,10 @@ The class handles SEH errors - `STATUS_NO_MEMORY` exceptions are automatically mapped to the class. - `STATUS_ACCESS_VIOLATION` exceptions are automatically mapped as follows: - - If `legacyNullReferencePolicy` is applied, all access violations are mapped to the class. - - If the address at which the read/write was attempted is not in JIT-compiled code, the exception is mapped to the class. - - If the address at which the read/write was attempted is in JIT-compiled code, but it is not in the OS Null partition area, the exception is mapped to the class. - - If there is no `legacyNullReferencePolicy`, and the address at which the read/write was attempted is in JIT-compiled code and in the OS Null partition area, the exception is mapped to the class. + - If `legacyNullReferencePolicy` is applied, all access violations are mapped to the class. + - If the address at which the read/write was attempted is not in JIT-compiled code, the exception is mapped to the class. + - If the address at which the read/write was attempted is in JIT-compiled code, but it is not in the OS Null partition area, the exception is mapped to the class. + - If there is no `legacyNullReferencePolicy`, and the address at which the read/write was attempted is in JIT-compiled code and in the OS Null partition area, the exception is mapped to the class. Any SEH exception that is not automatically mapped to a specific exception is mapped to the class by default. diff --git a/xml/System.Speech.Recognition/RecognizedAudio.xml b/xml/System.Speech.Recognition/RecognizedAudio.xml index 046f58ce58c..20d16603c2c 100644 --- a/xml/System.Speech.Recognition/RecognizedAudio.xml +++ b/xml/System.Speech.Recognition/RecognizedAudio.xml @@ -40,25 +40,25 @@ - Events: - - and + - and - - and + - and - - and + - and - - and + - and - - + - - Methods: - - and + - and - - and + - and - - + - - - + - > [!IMPORTANT] > A recognition result produced by emulated speech recognition does not contain recognized audio. For such a recognition result, its property returns `null` and its method throws an exception. For more information about emulated speech recognition, see the `EmulateRecognize` and `EmulateRecognizeAsync` methods of the and classes. diff --git a/xml/System.Speech.Recognition/SemanticResultValue.xml b/xml/System.Speech.Recognition/SemanticResultValue.xml index 3cb73af67d5..f3372e837ba 100644 --- a/xml/System.Speech.Recognition/SemanticResultValue.xml +++ b/xml/System.Speech.Recognition/SemanticResultValue.xml @@ -45,24 +45,24 @@ - If only the value (specified by an instance of ) is used to construct a object, the is associated with the grammar component that preceded it, in addition to a object. - For instance, in the code fragment below, if a constructed using this instance recognizes the word "background", a value of `true` is set in the recognized phrase semantics. + For instance, in the code fragment below, if a constructed using this instance recognizes the word "background", a value of `true` is set in the recognized phrase semantics. - ```csharp + ```csharp GrammarBuilder backgroundGB=new GrammarBuilder("background"); backgroundGB.Append(new SemanticResultValue(true)); - ``` + ``` - For more information, see the description of . + For more information, see the description of . - If a string value phrase or specific instance is used, together with a that specifies a value, that value is automatically associated with the string value phrase or the instance. If the phrase or object is used in the process of recognition, the value will be assigned to the semantics of the recognized phrase. - The following example illustrates this, and is functionally equivalent to the preceding example, which used explicit calls to and . If the recognition logic uses the word "background", the value `true` will be added to the recognized semantics. + The following example illustrates this, and is functionally equivalent to the preceding example, which used explicit calls to and . If the recognition logic uses the word "background", the value `true` will be added to the recognized semantics. - ```csharp + ```csharp fgOrbgChoice.Add((GrammarBuilder)new SemanticResultValue("background", true)); - ``` + ``` - For more information, see the description of and . + For more information, see the description of and . To be used by a in recognition, all instances must be associated with one of the objects used by that . This is done by associating a semantic key with the . diff --git a/xml/System.Speech.Recognition/SemanticValue.xml b/xml/System.Speech.Recognition/SemanticValue.xml index b1926bcd4c2..48fe3d34ee0 100644 --- a/xml/System.Speech.Recognition/SemanticValue.xml +++ b/xml/System.Speech.Recognition/SemanticValue.xml @@ -70,12 +70,12 @@ - A collection of name/value pairs () of child objects, which are also instances. Child nodes are accessible through the implementation of using a string lookup key and a instance, as in the following example. - ```csharp + ```csharp foreach (KeyValuePair child in semantics) { Utils.CreateSemanticsTreeNodes(semanticsNode.Nodes, child.Value, child.Key); } - ``` + ``` Recognition engines based on System.Speech provide valid instances of for all output from recognition, even for phrases with no explicit semantic structure. diff --git a/xml/System.Speech.Synthesis.TtsEngine/EventParameterType.xml b/xml/System.Speech.Synthesis.TtsEngine/EventParameterType.xml index 397628c8c5b..67bf89e27c4 100644 --- a/xml/System.Speech.Synthesis.TtsEngine/EventParameterType.xml +++ b/xml/System.Speech.Synthesis.TtsEngine/EventParameterType.xml @@ -40,19 +40,18 @@ For detailed information on how use `EventParameterType`, see the documentation ## Examples The following example is part of a custom speech synthesis implementation inheriting from , and using the use of , , , and . - The implementation of + The implementation of : -1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. +1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. -2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation +2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation - - Translates Americanism to Britishisms in the text to be spoken. + - Translates Americanism to Britishisms in the text to be spoken. + - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. - - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. + The parameters on , including the member value returned by , are used to log the event generated through the `LogSpeechEvent` method. - The parameters on , including the member value returned by , are used to log the event generated through the `LogSpeechEvent` method. - -3. A speech rendering engine is then called with the modified array. +3. A speech rendering engine is then called with the modified array. ```csharp private const int WordBoundaryFlag = 1 << (int)TtsEventId.WordBoundary; diff --git a/xml/System.Speech.Synthesis.TtsEngine/FragmentState.xml b/xml/System.Speech.Synthesis.TtsEngine/FragmentState.xml index 9431377c6d4..1f0fe2d5b2a 100644 --- a/xml/System.Speech.Synthesis.TtsEngine/FragmentState.xml +++ b/xml/System.Speech.Synthesis.TtsEngine/FragmentState.xml @@ -194,17 +194,16 @@ ## Remarks The interpretation of the value returned by depends on the value returned by the property on the current . -1. If the value of is +1. If the value of is - - If is positive, the value returned should be interpreted as the length of the silence in milliseconds. + - If is positive, the value returned should be interpreted as the length of the silence in milliseconds. + - If is negative, the value returned should be interpreted as a member of the . - - If is negative, the value returned should be interpreted as a member of the . + Emphasis information returned by when the property is corresponds to the attributes of the `` element of SSML input to a speech synthesizer engine. - Emphasis information returned by when the property is corresponds to the attributes of the `` element of SSML input to a speech synthesizer engine. +2. For all other values of , the values should be interpreted as being of . -2. For all other values of , the values should be interpreted as being of . - - Emphasis information returned by for spoken words corresponds to the attributes of the `` element of SSML input to a speech synthesizer engine. + Emphasis information returned by for spoken words corresponds to the attributes of the `` element of SSML input to a speech synthesizer engine. ]]> diff --git a/xml/System.Speech.Synthesis.TtsEngine/SpeechEventInfo.xml b/xml/System.Speech.Synthesis.TtsEngine/SpeechEventInfo.xml index aaf92fef58e..3e5a2706232 100644 --- a/xml/System.Speech.Synthesis.TtsEngine/SpeechEventInfo.xml +++ b/xml/System.Speech.Synthesis.TtsEngine/SpeechEventInfo.xml @@ -43,15 +43,14 @@ ## Examples The example below is part of a custom speech synthesis implementation inheriting from , and using the use of , , , and - The implementation of +The implementation of :: 1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. 2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation - - Translates Americanism to Britishisms in the text to be spoken. - - - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. + - Translates Americanism to Britishisms in the text to be spoken. + - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. 3. A speech rendering engine is then called with the modified array. @@ -148,20 +147,18 @@ override public void Speak (TextFragment [] frags, IntPtr wfx, ITtsEngineSite si The type of the events which can be handled by the Speech platform infrastructure can be obtained through the property on the synthesizer engine site implementation of . - - ## Examples The example below is part of a custom speech synthesis implementation inheriting from , and using the use of , , , and - The implementation of +The implementation of : 1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. 2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation - - Translates Americanism to Britishisms in the text to be spoken. + - Translates Americanism to Britishisms in the text to be spoken. - - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. + - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. 3. A speech rendering engine is then called with the modified array. @@ -317,17 +314,17 @@ override public void Speak (TextFragment [] frags, IntPtr wfx, ITtsEngineSite si ## Examples The example below is part of a custom speech synthesis implementation inheriting from , and using the use of , , , and - The implementation of +The implementation of : 1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. 2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation - - Translates Americanism to Britishisms in the text to be spoken. + - Translates Americanism to Britishisms in the text to be spoken. - - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. + - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. - The parameters on , including are used to log the event generated through the `LogSpeechEvent` method. + The parameters on , including are used to log the event generated through the `LogSpeechEvent` method. 3. A speech rendering engine is then called with the modified array. @@ -506,17 +503,17 @@ override public void Speak (TextFragment [] frags, IntPtr wfx, ITtsEngineSite si ## Examples The example below is part of a custom speech synthesis implementation inheriting from , and using the use of , , , and - The implementation of +The implementation of : 1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. 2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation - - Translates Americanism to Britishisms in the text to be spoken. + - Translates Americanism to Britishisms in the text to be spoken. - - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. + - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. - The parameters on , including are used to log the event generated through the `LogSpeechEvent` method. + The parameters on , including are used to log the event generated through the `LogSpeechEvent` method. 3. A speech rendering engine is then called with the modified array. @@ -610,17 +607,17 @@ override public void Speak (TextFragment [] frags, IntPtr wfx, ITtsEngineSite si ## Examples The example below is part of a custom speech synthesis implementation inheriting from , and using the use of , , , and - The implementation of +The implementation of : 1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. 2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation - - Translates Americanism to Britishisms in the text to be spoken. + - Translates Americanism to Britishisms in the text to be spoken. - - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. + - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. - The parameters on , including are used to log the event generated through the `LogSpeechEvent` method. + The parameters on , including are used to log the event generated through the `LogSpeechEvent` method. 3. A speech rendering engine is then called with the modified array. @@ -714,17 +711,17 @@ override public void Speak (TextFragment [] frags, IntPtr wfx, ITtsEngineSite si ## Examples The example below is part of a custom speech synthesis implementation inheriting from , and using the use of , , , and - The implementation of +The implementation of : 1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. 2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation - - Translates Americanism to Britishisms in the text to be spoken. + - Translates Americanism to Britishisms in the text to be spoken. - - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. + - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. - The parameters on , including are used to log the event generated through the `LogSpeechEvent` method. + The parameters on , including are used to log the event generated through the `LogSpeechEvent` method. 3. A speech rendering engine is then called with the modified array. diff --git a/xml/System.Speech.Synthesis.TtsEngine/TextFragment.xml b/xml/System.Speech.Synthesis.TtsEngine/TextFragment.xml index 36e24d7ac82..d9162be14d1 100644 --- a/xml/System.Speech.Synthesis.TtsEngine/TextFragment.xml +++ b/xml/System.Speech.Synthesis.TtsEngine/TextFragment.xml @@ -40,26 +40,23 @@ Speech attribute information, such as emphasis, pitch, and rate, are obtained from the object returned by the property. - - ## Examples The example below is part of a custom speech synthesis implementation inheriting from , and using the use of , , , and . The implementation of -1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. +1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. - Particular care is used to respect the , on the original when creating the on the new instances. + Particular care is used to respect the , on the original when creating the on the new instances. -2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation +2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation - - Translates Americanism to Britishisms in the text to be spoken. + - Translates Americanism to Britishisms in the text to be spoken. + - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. - - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. +3. A speech rendering engine is then called with the modified array. -3. A speech rendering engine is then called with the modified array. - -``` +```csharp private const int WordBoundaryFlag = 1 << (int)TtsEventId.WordBoundary; private readonly char[] spaces = new char[] { ' ', '\t', '\r', '\n' }; internal struct UsVsUk @@ -201,19 +198,18 @@ override public void Speak (TextFragment [] frags, IntPtr wfx, ITtsEngineSite si The implementation of -1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. +1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. - Particular care is used to respect the , on the original when creating the on the new instances. + Particular care is used to respect the , on the original when creating the on the new instances. -2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation +2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation - - Translates Americanism to Britishisms in the text to be spoken. + - Translates Americanism to Britishisms in the text to be spoken. + - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. - - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. +3. A speech rendering engine is then called with the modified array. -3. A speech rendering engine is then called with the modified array. - -``` +```csharp private const int WordBoundaryFlag = 1 << (int)TtsEventId.WordBoundary; private readonly char[] spaces = new char[] { ' ', '\t', '\r', '\n' }; internal struct UsVsUk @@ -292,26 +288,23 @@ override public void Speak (TextFragment [] frags, IntPtr wfx, ITtsEngineSite si ## Remarks The default value of this property is 0. - - ## Examples The example below is part of a custom speech synthesis implementation inheriting from , and using the use of , , , and . The implementation of -1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. - - Particular care is used to respect the , on the original when creating the on the new instances. +1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. -2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation + Particular care is used to respect the , on the original when creating the on the new instances. - - Translates Americanism to Britishisms in the text to be spoken. +2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation - - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. + - Translates Americanism to Britishisms in the text to be spoken. + - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. -3. A speech rendering engine is then called with the modified array. +3. A speech rendering engine is then called with the modified array. -``` +```csharp private const int WordBoundaryFlag = 1 << (int)TtsEventId.WordBoundary; private readonly char[] spaces = new char[] { ' ', '\t', '\r', '\n' }; internal struct UsVsUk @@ -394,26 +387,23 @@ override public void Speak (TextFragment [] frags, IntPtr wfx, ITtsEngineSite si Resetting the value of will not change the value of and . - - ## Examples The example below is part of a custom speech synthesis implementation inheriting from , and using the use of , , , and . The implementation of -1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. - - Particular care is used to respect the , on the original when creating the on the new instances. +1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. -2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation + Particular care is used to respect the , on the original when creating the on the new instances. - - Translates Americanism to Britishisms in the text to be spoken. +2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation - - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. + - Translates Americanism to Britishisms in the text to be spoken. + - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. -3. A speech rendering engine is then called with the modified array. +3. A speech rendering engine is then called with the modified array. -``` +```csharp private const int WordBoundaryFlag = 1 << (int)TtsEventId.WordBoundary; private readonly char[] spaces = new char[] { ' ', '\t', '\r', '\n' }; internal struct UsVsUk diff --git a/xml/System.Speech.Synthesis.TtsEngine/TtsEngineAction.xml b/xml/System.Speech.Synthesis.TtsEngine/TtsEngineAction.xml index 334413887cb..1191a674d6a 100644 --- a/xml/System.Speech.Synthesis.TtsEngine/TtsEngineAction.xml +++ b/xml/System.Speech.Synthesis.TtsEngine/TtsEngineAction.xml @@ -34,22 +34,20 @@ Processing of the value returned by the property is handled by a speech synthesizes implementation of the method on a class derived from . - - ## Examples The following example is part of a custom speech synthesis implementation inheriting from , and using the use of , , and The implementation of -1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. +1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. -2. If the enumeration value by found from the property on the returned by the property of each instance is Speak, the implementation +2. If the enumeration value by found from the property on the returned by the property of each instance is Speak, the implementation - - Translates Americanism to Britishisms in the text to be spoken. + - Translates Americanism to Britishisms in the text to be spoken. - - If the property on the interface provided to the implementation support the event type, an event to drive a synthesizer progress meter is created. + - If the property on the interface provided to the implementation support the event type, an event to drive a synthesizer progress meter is created. -3. A speech rendering engine is then called with the modified array. +3. A speech rendering engine is then called with the modified array. ```csharp private const int WordBoundaryFlag = 1 << (int)TtsEventId.WordBoundary; diff --git a/xml/System.Speech.Synthesis.TtsEngine/TtsEngineSsml.xml b/xml/System.Speech.Synthesis.TtsEngine/TtsEngineSsml.xml index ddb797b2cd1..341c5ea4954 100644 --- a/xml/System.Speech.Synthesis.TtsEngine/TtsEngineSsml.xml +++ b/xml/System.Speech.Synthesis.TtsEngine/TtsEngineSsml.xml @@ -44,9 +44,9 @@ The method is called by the infrastructures text parser receiving: -1. A reference to the interface, which provides access to system services such as even queuing and writing audio output. +1. A reference to the interface, which provides access to system services such as even queuing and writing audio output. -2. An array of instance produced from Speech Synthesis Markup Language (SSML) input. In addition to text to be rendered as speech, the parsing of the SSML stores information about the requested attributes of the speech in a instance associated with each incoming object. +2. An array of instance produced from Speech Synthesis Markup Language (SSML) input. In addition to text to be rendered as speech, the parsing of the SSML stores information about the requested attributes of the speech in a instance associated with each incoming object. A speech synthesizer application can optionally make requests for a specified output format by implementing to be called by the platform when it tries to provide the correct audio output. @@ -362,17 +362,17 @@ internal struct WaveFormat ## Examples The example below is part of a custom speech synthesis implementation inheriting from , and using the use of , , , and - The implementation of +The implementation of : -1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. +1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. -2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation +2. If the enumeration value by found from the property on the returned by the property of each instance is , the implementation - - Translates Americanism to Britishisms in the text to be spoken. + - Translates Americanism to Britishisms in the text to be spoken. - - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. + - If the property on the interfaces provided to the implementation support the event type, a instance is used to create an event to drive a synthesizer progress meter is created. -3. A speech rendering engine is then called with the modified array. +3. A speech rendering engine is then called with the modified array. ``` private const int WordBoundaryFlag = 1 << (int)TtsEventId.WordBoundary; @@ -430,11 +430,11 @@ override public void Speak (TextFragment [] frags, IntPtr wfx, ITtsEngineSite si A implementation: -1. Traps or modify aspects of the incoming objects +1. Traps or modify aspects of the incoming objects -2. Generates any necessary events using the site reference to a instance +2. Generates any necessary events using the site reference to a instance -3. Generates the actual synthesized speech. +3. Generates the actual synthesized speech. Generation of speech is most typically done by calling Speak on one of the speech rendering engines provided by the operating system. diff --git a/xml/System.Speech.Synthesis.TtsEngine/TtsEventId.xml b/xml/System.Speech.Synthesis.TtsEngine/TtsEventId.xml index f6f6e80956e..2d477689fdd 100644 --- a/xml/System.Speech.Synthesis.TtsEngine/TtsEventId.xml +++ b/xml/System.Speech.Synthesis.TtsEngine/TtsEventId.xml @@ -35,23 +35,20 @@ The value of is a bitmask, where the members of define the location of the bit corresponding to the event type. For example, WordBoundary has a value of five (5), meaning the fifth bit in the value returned by indicates if the site supports the event type. - - ## Examples The following example is part of a custom speech synthesis implementation inheriting from , and using the , , , and classes. The implementation of includes the following steps: -1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. +1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. -2. If the property of each instance is equal to +2. If the property of each instance is equal to , the code does the following: - - Translates American English to British English in the text to be spoken. - - - If the property provided to the implementation supports the `WordBoundary` event type, a instance is used to create an event to drive a synthesizer progress meter is created. + - Translates American English to British English in the text to be spoken. + - If the property provided to the implementation supports the `WordBoundary` event type, a instance is used to create an event to drive a synthesizer progress meter is created. -3. A speech rendering engine is then called with the modified array. +3. A speech rendering engine is then called with the modified array. ```csharp private const int WordBoundaryFlag = 1 << (int)TtsEventId.WordBoundary; diff --git a/xml/System.Text/Encoding.xml b/xml/System.Text/Encoding.xml index f0a619f4534..f84914868b1 100644 --- a/xml/System.Text/Encoding.xml +++ b/xml/System.Text/Encoding.xml @@ -5785,8 +5785,8 @@ If multiple providers are registered, object that uses replacement fallback to replace each string that it can't encode and each byte that it can't decode with a question mark ("?") character. Instead, you can call the constructor to instantiate a object whose fallback is either an or a , as the following example illustrates. - :::code language="csharp" source="~/snippets/csharp/System.Text/Encoding/UTF8/encoding.utf8.1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System.Text/Encoding/UTF8/encoding.utf8.1.vb" id="Snippet1"::: + :::code language="csharp" source="~/snippets/csharp/System.Text/Encoding/UTF8/encoding.utf8.1.cs" id="Snippet1"::: + :::code language="vb" source="~/snippets/visualbasic/System.Text/Encoding/UTF8/encoding.utf8.1.vb" id="Snippet1"::: ## Examples The following example defines an array that consists of the following characters: diff --git a/xml/System.Threading.Tasks/Task.xml b/xml/System.Threading.Tasks/Task.xml index a7cc342dc93..690b0ba60b1 100644 --- a/xml/System.Threading.Tasks/Task.xml +++ b/xml/System.Threading.Tasks/Task.xml @@ -2694,15 +2694,15 @@ End Sub - At the beginning of the task, as the following example shows. - :::code language="csharp" source="~/snippets/csharp/System.Threading.Tasks/Task/Delay/delay5.cs" id="Snippet5"::: - :::code language="fsharp" source="~/snippets/fsharp/System.Threading.Tasks/Task/Delay/delay5.fs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/System.Threading.Tasks/Task/Delay/delay5.vb" id="Snippet5"::: + :::code language="csharp" source="~/snippets/csharp/System.Threading.Tasks/Task/Delay/delay5.cs" id="Snippet5"::: + :::code language="fsharp" source="~/snippets/fsharp/System.Threading.Tasks/Task/Delay/delay5.fs" id="Snippet5"::: + :::code language="vb" source="~/snippets/visualbasic/System.Threading.Tasks/Task/Delay/delay5.vb" id="Snippet5"::: - Sometime while the task is executing. In this case, the call to the method executes as a child task within a task, as the following example shows. Note that since the task that calls the method executes asynchronously, the parent task must wait for it to complete by using the `await` keyword. - :::code language="csharp" source="~/snippets/csharp/System.Threading.Tasks/Task/Delay/delay5.cs" id="Snippet7"::: - :::code language="fsharp" source="~/snippets/fsharp/System.Threading.Tasks/Task/Delay/delay5.fs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/System.Threading.Tasks/Task/Delay/delay5.vb" id="Snippet7"::: + :::code language="csharp" source="~/snippets/csharp/System.Threading.Tasks/Task/Delay/delay5.cs" id="Snippet7"::: + :::code language="fsharp" source="~/snippets/fsharp/System.Threading.Tasks/Task/Delay/delay5.fs" id="Snippet7"::: + :::code language="vb" source="~/snippets/visualbasic/System.Threading.Tasks/Task/Delay/delay5.vb" id="Snippet7"::: After the specified time delay, the task is completed in the state. diff --git a/xml/System.Threading/Thread.xml b/xml/System.Threading/Thread.xml index f5560aa66f0..feade230857 100644 --- a/xml/System.Threading/Thread.xml +++ b/xml/System.Threading/Thread.xml @@ -78,13 +78,13 @@ The constructors can take either of two delegate - If the method has no arguments, you pass a delegate to the constructor. It has the signature: - ```csharp + ```csharp public delegate void ThreadStart() - ``` + ``` - ```vb + ```vb Public Delegate Sub ThreadStart() - ``` + ``` The following example creates and starts a thread that executes the `ExecuteInForeground` method. The method displays information about some thread properties, then executes a loop in which it pauses for half a second and displays the elapsed number of seconds. When the thread has executed for at least five seconds, the loop ends and the thread terminates execution. @@ -94,13 +94,13 @@ The constructors can take either of two delegate - If the method has an argument, you pass a delegate to the constructor. It has the signature: - ```csharp + ```csharp public delegate void ParameterizedThreadStart(object obj) - ``` + ``` - ```vb + ```vb Public Delegate Sub ParameterizedThreadStart(obj As Object) - ``` + ``` The method executed by the delegate can then cast (in C#) or convert (in Visual Basic) the parameter to the appropriate type. diff --git a/xml/System.Threading/ThreadPool.xml b/xml/System.Threading/ThreadPool.xml index cb5545882dd..b593b0799a4 100644 --- a/xml/System.Threading/ThreadPool.xml +++ b/xml/System.Threading/ThreadPool.xml @@ -64,23 +64,13 @@ - When you use registered wait handles, a system thread monitors the status of the wait handles. When a wait operation completes, a worker thread from the thread pool executes the corresponding callback function. -- When you call the method to queue a method for execution on a thread pool thread. You do this by passing the method a delegate. The delegate has the signature - - ```csharp - void WaitCallback(Object state) - ``` - - ```vb - Sub WaitCallback(state As Object) - ``` - - where `state` is an object that contains data to be used by the delegate. The actual data can be passed to the delegate by calling the method. +- When you call the method to queue a method for execution on a thread pool thread. You do this by passing the method a delegate. The delegate has the signature `void WaitCallback(Object state)`, where `state` is an object that contains data to be used by the delegate. The actual data can be passed to the delegate by calling the method. > [!NOTE] -> The threads in the managed thread pool are background threads. That is, their properties are `true`. This means that a thread will not keep an application running after all foreground threads have exited. +> The threads in the managed thread pool are background threads. That is, their properties are `true`. This means that a thread will not keep an application running after all foreground threads have exited. > [!IMPORTANT] -> When the thread pool reuses a thread, it does not clear the data in thread local storage or in fields that are marked with the attribute. Therefore, when a method examines thread local storage or fields that are marked with the attribute, the values it finds might be left over from an earlier use of the thread pool thread. +> When the thread pool reuses a thread, it does not clear the data in thread local storage or in fields that are marked with the attribute. Therefore, when a method examines thread local storage or fields that are marked with the attribute, the values it finds might be left over from an earlier use of the thread pool thread. You can also queue work items that are not related to a wait operation to the thread pool. To request that a work item be handled by a thread in the thread pool, call the method. This method takes as a parameter a reference to the method or delegate that will be called by the thread selected from the thread pool. There is no way to cancel a work item after it has been queued. @@ -94,12 +84,12 @@ The thread pool provides new worker threads or I/O completion threads on demand until it reaches the maximum for each category. When a maximum is reached, the thread pool can create additional threads in that category or wait until some tasks complete. The thread pool creates and destroys worker threads in order to optimize throughput, which is defined as the number of tasks that complete per unit of time. Too few threads might not make optimal use of available resources, whereas too many threads could increase resource contention. > [!NOTE] -> When demand is low, the actual number of thread pool threads can fall below the minimum values. +> When demand is low, the actual number of thread pool threads can fall below the minimum values. You can use the method to obtain these minimum values. > [!CAUTION] -> You can use the method to increase the minimum number of threads. However, unnecessarily increasing these values can cause performance problems. If too many tasks start at the same time, all of them might appear to be slow. In most cases the thread pool will perform better with its own algorithm for allocating threads. +> You can use the method to increase the minimum number of threads. However, unnecessarily increasing these values can cause performance problems. If too many tasks start at the same time, all of them might appear to be slow. In most cases the thread pool will perform better with its own algorithm for allocating threads. ## Examples In the following example, the main application thread queues a method named `ThreadProc` to execute on a thread pool thread, sleeps for one second, and then exits. The `ThreadProc` method simply displays a message. @@ -492,7 +482,7 @@ If a thread pool implementation may have different types of work items, the coun The thread pool provides new worker threads or I/O completion threads on demand until it reaches the minimum for each category. By default, the minimum number of threads is set to the number of processors on a system. When the minimum is reached, the thread pool can create additional threads in that category or wait until some tasks complete. The thread pool creates and destroys threads in order to optimize throughput, which is defined as the number of tasks that complete per unit of time. Too few threads might not make optimal use of available resources, whereas too many threads could increase resource contention. > [!NOTE] -> When demand is low, the actual number of thread pool threads can fall below the minimum values. +> When demand is low, the actual number of thread pool threads can fall below the minimum values. ## Examples The following example sets the minimum number of worker threads to four, and preserves the original value for the minimum number of asynchronous I/O completion threads. @@ -850,7 +840,7 @@ The following example uses the method checks the current state of the specified object's . If the object's state is unsignaled, the method registers a wait operation. The wait operation is performed by a thread from the thread pool. The delegate is executed by a worker thread when the object's state becomes signaled or the time-out interval elapses. If the `timeOutInterval` parameter is not 0 (zero) and the `executeOnlyOnce` parameter is `false`, the timer is reset every time the event is signaled or the time-out interval elapses. > [!IMPORTANT] -> Using a for `waitObject` does not provide mutual exclusion for the callbacks because the underlying Windows API uses the default `WT_EXECUTEDEFAULT` flag, so each callback is dispatched on a separate thread pool thread. Instead of a , use a with a maximum count of 1. +> Using a for `waitObject` does not provide mutual exclusion for the callbacks because the underlying Windows API uses the default `WT_EXECUTEDEFAULT` flag, so each callback is dispatched on a separate thread pool thread. Instead of a , use a with a maximum count of 1. To cancel the wait operation, call the method. @@ -945,7 +935,7 @@ The following example uses the method checks the current state of the specified object's . If the object's state is unsignaled, the method registers a wait operation. The wait operation is performed by a thread from the thread pool. The delegate is executed by a worker thread when the object's state becomes signaled or the time-out interval elapses. If the `timeOutInterval` parameter is not 0 (zero) and the `executeOnlyOnce` parameter is `false`, the timer is reset every time the event is signaled or the time-out interval elapses. > [!IMPORTANT] -> Using a for `waitObject` does not provide mutual exclusion for the callbacks because the underlying Windows API uses the default `WT_EXECUTEDEFAULT` flag, so each callback is dispatched on a separate thread pool thread. Instead of a , use a with a maximum count of 1. +> Using a for `waitObject` does not provide mutual exclusion for the callbacks because the underlying Windows API uses the default `WT_EXECUTEDEFAULT` flag, so each callback is dispatched on a separate thread pool thread. Instead of a , use a with a maximum count of 1. To cancel the wait operation, call the method. @@ -1040,7 +1030,7 @@ The following example uses the method checks the current state of the specified object's . If the object's state is unsignaled, the method registers a wait operation. The wait operation is performed by a thread from the thread pool. The delegate is executed by a worker thread when the object's state becomes signaled or the time-out interval elapses. If the `timeOutInterval` parameter is not 0 (zero) and the `executeOnlyOnce` parameter is `false`, the timer is reset every time the event is signaled or the time-out interval elapses. > [!IMPORTANT] -> Using a for `waitObject` does not provide mutual exclusion for the callbacks because the underlying Windows API uses the default `WT_EXECUTEDEFAULT` flag, so each callback is dispatched on a separate thread pool thread. Instead of a , use a with a maximum count of 1. +> Using a for `waitObject` does not provide mutual exclusion for the callbacks because the underlying Windows API uses the default `WT_EXECUTEDEFAULT` flag, so each callback is dispatched on a separate thread pool thread. Instead of a , use a with a maximum count of 1. To cancel the wait operation, call the method. @@ -1140,7 +1130,7 @@ The following example uses the method checks the current state of the specified object's . If the object's state is unsignaled, the method registers a wait operation. The wait operation is performed by a thread from the thread pool. The delegate is executed by a worker thread when the object's state becomes signaled or the time-out interval elapses. If the `timeOutInterval` parameter is not 0 (zero) and the `executeOnlyOnce` parameter is `false`, the timer is reset every time the event is signaled or the time-out interval elapses. > [!IMPORTANT] -> Using a for `waitObject` does not provide mutual exclusion for the callbacks because the underlying Windows API uses the default `WT_EXECUTEDEFAULT` flag, so each callback is dispatched on a separate thread pool thread. Instead of a , use a with a maximum count of 1. +> Using a for `waitObject` does not provide mutual exclusion for the callbacks because the underlying Windows API uses the default `WT_EXECUTEDEFAULT` flag, so each callback is dispatched on a separate thread pool thread. Instead of a , use a with a maximum count of 1. To cancel the wait operation, call the method. @@ -1226,7 +1216,7 @@ The following example uses the [!NOTE] -> The thread pool may have upper limits for the maximum thread counts (such as `short.MaxValue`, depending on the implementation). The argument values are capped to the upper limit, so even when the method returns `true`, the actual maximum thread counts may be lower than requested. +> The thread pool may have upper limits for the maximum thread counts (such as `short.MaxValue`, depending on the implementation). The argument values are capped to the upper limit, so even when the method returns `true`, the actual maximum thread counts may be lower than requested. ]]> diff --git a/xml/System.Xml.Schema/Extensions.xml b/xml/System.Xml.Schema/Extensions.xml index dbd3b5637d8..cb226a3a2ef 100644 --- a/xml/System.Xml.Schema/Extensions.xml +++ b/xml/System.Xml.Schema/Extensions.xml @@ -729,25 +729,22 @@ doc2 did not validate To validate an attribute, you use an instance of . You can obtain this instance in various ways. An easy way is as follows: -1. Validate that a document conforms to a schema. +1. Validate that a document conforms to a schema. -2. Add the post-schema-validation infoset (PSVI) by calling the extension method. +2. Add the post-schema-validation infoset (PSVI) by calling the extension method. -3. Call the extension method to retrieve an object that implements . From the retrieved object, you can get an . +3. Call the extension method to retrieve an object that implements . From the retrieved object, you can get an . - - If you get an for an , the type will be . + - If you get an for an , the type will be . - - If you get an for an , the type will be . + - If you get an for an , the type will be . After you have an instance of an , you can use this method to validate an attribute. - - ## Examples ```csharp - - string xsdMarkup = +string xsdMarkup = @" @@ -797,7 +794,7 @@ lang.Validate(lang.GetSchemaInfo().SchemaAttribute, schemas, (sender, e) => }); Console.WriteLine("lang {0}", errors ? "did not validate" : "validated"); -// the following makes the Lang attribute invalid according to the schema +// The following makes the Lang attribute invalid according to the schema lang.Value = "VC"; Console.WriteLine(); @@ -813,8 +810,7 @@ Console.WriteLine("lang {0}", errors ? "did not validate" : "validated"); ``` ```vb - - Dim errors As Boolean = False +Dim errors As Boolean = False Private Sub XSDErrors(ByVal o As Object, ByVal e As ValidationEventArgs) Console.WriteLine("{0}", e.Message) @@ -874,7 +870,7 @@ Sub Main() End Sub ``` - This example produces the following output: +This example produces the following output: ``` Validating doc1 ... @@ -958,9 +954,9 @@ lang did not validate There are two steps to populating the XML tree with the PSVI. -1. First, an annotation is added to all nodes in the tree to enable you to call or on an element or attribute in the tree. +1. First, an annotation is added to all nodes in the tree to enable you to call or on an element or attribute in the tree. -2. Second, default elements and attributes defined in the XSD are added to the XML tree. By calling one of the methods, you can determine if a specific element or attribute was added from the XSD as a default element or attribute. +2. Second, default elements and attributes defined in the XSD are added to the XML tree. By calling one of the methods, you can determine if a specific element or attribute was added from the XSD as a default element or attribute. @@ -1364,25 +1360,22 @@ Invalid Element /Root/Child1/GrandChild3 To validate a sub-tree, you use an instance of . You can obtain this instance in various ways. An easy way is as follows: -1. Validate that a document conforms to a schema. +1. Validate that a document conforms to a schema. -2. Add the post-schema-validation infoset (PSVI) by calling the extension method. +2. Add the post-schema-validation infoset (PSVI) by calling the extension method. -3. Call the extension method to retrieve an object that implements . From the retrieved object, you can get an . +3. Call the extension method to retrieve an object that implements . From the retrieved object, you can get an . - - If you get an for an , the type will be . + - If you get an for an , the type will be . - - If you get an for an , the type will be . + - If you get an for an , the type will be . After you have an instance of an , you can use this method to validate an sub-tree. - - ## Examples ```csharp - - string xsdMarkup = +string xsdMarkup = @" @@ -1446,8 +1439,7 @@ Console.WriteLine("child1 {0}", errors ? "did not validate" : "validated"); ``` ```vb - - Dim errors As Boolean = False +Dim errors As Boolean = False Private Sub XSDErrors(ByVal o As Object, ByVal e As ValidationEventArgs) Console.WriteLine("{0}", e.Message) @@ -1509,7 +1501,7 @@ Sub Main() End Sub ``` - This example produces the following output: +This example produces the following output: ``` Validating doc1 ... @@ -1597,25 +1589,22 @@ child1 did not validate To validate an attribute, you use an instance of . You can obtain this instance in various ways. An easy way is as follows: -1. Validate that a document conforms to a schema. +1. Validate that a document conforms to a schema. -2. Add the post-schema-validation infoset (PSVI) by calling the extension method. +2. Add the post-schema-validation infoset (PSVI) by calling the extension method. -3. Call the extension method to retrieve an object that implements . From the retrieved object, you can get an . +3. Call the extension method to retrieve an object that implements . From the retrieved object, you can get an . - - If you get an for an , the type will be . + - If you get an for an , the type will be . - - If you get an for an , the type will be . + - If you get an for an , the type will be . After you have an instance of an , you can use this method to validate an attribute. - - ## Examples ```csharp - - static void DumpInvalidNodes(XElement el) +static void DumpInvalidNodes(XElement el) { if (el.GetSchemaInfo().Validity != XmlSchemaValidity.Valid) Console.WriteLine("Invalid Element {0}", @@ -1708,8 +1697,7 @@ static void Main(string[] args) ``` ```vb - - Private Sub DumpInvalidNodes(ByVal el As XElement) +Private Sub DumpInvalidNodes(ByVal el As XElement) If el.GetSchemaInfo.Validity <> XmlSchemaValidity.Valid Then Console.WriteLine("Invalid Element {0}", _ el _ @@ -1799,7 +1787,7 @@ Sub Main() End Sub ``` - This example produces the following output: +This example produces the following output: ``` Validating doc1 ... @@ -1894,25 +1882,22 @@ Invalid Attribute /Root/@Lang To validate a sub-tree, you use an instance of . You can obtain this instance in various ways. An easy way is as follows: -1. Validate that a document conforms to a schema. - -2. Add the post-schema-validation infoset (PSVI) by calling the extension method. +1. Validate that a document conforms to a schema. -3. Call the extension method to retrieve an object that implements . From the retrieved object, you can get an . +2. Add the post-schema-validation infoset (PSVI) by calling the extension method. - - If you get an for an , the type will be . +3. Call the extension method to retrieve an object that implements . From the retrieved object, you can get an . - - If you get an for an , the type will be . - - After you have an instance of an , you can use this method to validate a sub-tree.. + - If you get an for an , the type will be . + - If you get an for an , the type will be . +After you have an instance of an , you can use this method to validate a sub-tree. ## Examples ```csharp - - string xsdMarkup = +string xsdMarkup = @" @@ -1977,8 +1962,7 @@ Console.WriteLine(doc2); ``` ```vb - - Dim errors As Boolean = False +Dim errors As Boolean = False Private Sub XSDErrors(ByVal o As Object, ByVal e As ValidationEventArgs) Console.WriteLine("{0}", e.Message) @@ -2044,7 +2028,7 @@ Sub Main() End Sub ``` - This example produces the following output: +This example produces the following output: ``` Validating doc1 diff --git a/xml/System.Xml.Xsl/XslCompiledTransform.xml b/xml/System.Xml.Xsl/XslCompiledTransform.xml index e62fb9b51f4..21bb34fe089 100644 --- a/xml/System.Xml.Xsl/XslCompiledTransform.xml +++ b/xml/System.Xml.Xsl/XslCompiledTransform.xml @@ -206,7 +206,7 @@ The sample uses the following two input files: - The style sheet is passed to the method either as a URI, or an implementation of the class that implements the interface. The interface is implemented on all text-parsing objects. - In other words, if the style sheet is loaded using an object, such as an or , or an implementation that does not implement the interface, you cannot debug the style sheet. + In other words, if the style sheet is loaded using an object, such as an or , or an implementation that does not implement the interface, you cannot debug the style sheet. - The used to load the style sheet is a file-based , such as the (this is the default used by the class). diff --git a/xml/System.Xml/XmlWriter.xml b/xml/System.Xml/XmlWriter.xml index 7a0c7d1f6af..1e3915d9105 100644 --- a/xml/System.Xml/XmlWriter.xml +++ b/xml/System.Xml/XmlWriter.xml @@ -116,18 +116,18 @@ An XML writer uses two properties from the c - The property configures the XML writer to check that the stream being written complies with the rules for a well-formed XML 1.0 document or document fragment, as defined by the W3C. The three conformance levels are described in the following table. The default is . For details, see the property and the enumeration. - |Level|Description| - |-----------|-----------------| - ||The XML output conforms to the rules for a well-formed XML 1.0 document and can be processed by any conforming processor.| - ||The XML output conforms to the rules for a well-formed XML 1.0 document fragment.| - ||The XML writer determines which level of conformation checking to apply (document or fragment) based on the incoming data.| + |Level|Description| + |-----------|-----------------| + ||The XML output conforms to the rules for a well-formed XML 1.0 document and can be processed by any conforming processor.| + ||The XML output conforms to the rules for a well-formed XML 1.0 document fragment.| + ||The XML writer determines which level of conformation checking to apply (document or fragment) based on the incoming data.| ## Write elements You can use the following methods to write element nodes. For examples, see the methods listed. -|Use|To| -|---------|--------| +| Use | To | +|-----|----| ||Write an entire element node, including a string value.| ||To write an element value by using multiple method calls. For example, you can call to write a typed value, to write a character entity, to write an attribute, or you can write a child element. This is a more sophisticated version of the method.

To close the element, you call the or method.| ||To copy an element node found at the current position of an or object. When called, it copies everything from the source object to the instance.| @@ -136,8 +136,8 @@ You can use the following methods to write element n You can use the following methods to write attributes on element nodes. These methods can also be used to create namespace declarations on an element, as discussed in the next section. -|Use|To| -|---------|--------| +| Use | To | +|-----|----| ||To write an entire attribute node, including a string value.| ||To write the attribute value using multiple method calls. For example, you can call to write a typed value. This is a more sophisticated version of the method.

To close the element, you call the method.| ||To copy all the attributes found at the current position of an object. The attributes that are written depend on the type of node the reader is currently positioned on:

- For an attribute node, it writes the current attribute, and then the rest of the attributes until the element closing tag.
- For an element node, it writes all attributes contained by the element.
- For an XML declaration node, it writes all the attributes in the declaration.
- For all other node types, the method throws an exception.| @@ -157,11 +157,11 @@ The maintains a namespace stack that corresponds to The code generates the following XML string: - ```xml + ```xml - ``` + ``` - Specify a namespace prefix when writing attributes or elements. Many of the methods used to write element and attributes enable you to do this. For example, the method writes a start tag and associates it with a specified namespace and prefix. diff --git a/xml/System/ArgumentNullException.xml b/xml/System/ArgumentNullException.xml index d9adc2b9475..f2244295d41 100644 --- a/xml/System/ArgumentNullException.xml +++ b/xml/System/ArgumentNullException.xml @@ -199,7 +199,7 @@ | 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 `Value cannot be null. (Parameter name: 'arg1')`. | +| | A localized error message string that identifies the null argument. For example, if the `paramName` argument is "arg1", the English language message string is `Value cannot be null. (Parameter name: 'arg1')`. | | | The parameter name string. | ]]> diff --git a/xml/System/ArraySegment`1.xml b/xml/System/ArraySegment`1.xml index fbd91d57ff6..9c251b183d1 100644 --- a/xml/System/ArraySegment`1.xml +++ b/xml/System/ArraySegment`1.xml @@ -103,9 +103,9 @@ - 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"::: + :::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. diff --git a/xml/System/BitConverter.xml b/xml/System/BitConverter.xml index 2a6df3ffdda..eba1bb392a5 100644 --- a/xml/System/BitConverter.xml +++ b/xml/System/BitConverter.xml @@ -103,9 +103,9 @@ - If systems sending and receiving data can have different endianness, always transmit data in a particular order. This means that the order of bytes in the array may have to be reversed either before sending them or after receiving them. A common convention is to transmit data in network byte order (big-endian order). The following example provides an implementation for sending an integer value in network byte order. - :::code language="csharp" source="~/snippets/csharp/System/BitConverter/Overview/networkorder1.cs" id="Snippet4"::: - :::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"::: + :::code language="csharp" source="~/snippets/csharp/System/BitConverter/Overview/networkorder1.cs" id="Snippet4"::: + :::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. diff --git a/xml/System/Console.xml b/xml/System/Console.xml index 419432bd77e..3c0be1b3872 100644 --- a/xml/System/Console.xml +++ b/xml/System/Console.xml @@ -3159,34 +3159,34 @@ A property get operation might return a cached value instead of the console's cu - 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"::: + :::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: - ``` + ``` This is the first line. This is the second line. This is the third line. This is the fourth line. - ``` + ``` - 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"::: - :::code language="vb" source="~/snippets/visualbasic/System/Console/ReadLine/ReadLine3.vb" id="Snippet3"::: + :::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"::: + :::code language="vb" source="~/snippets/visualbasic/System/Console/ReadLine/ReadLine3.vb" id="Snippet3"::: - After compiling the example to an executable named ReadLine1.exe, you can run it from the command line to read the contents of the file and display them to the console. The syntax is: + After compiling the example to an executable named ReadLine1.exe, you can run it from the command line to read the contents of the file and display them to the console. The syntax is: - ``` + ``` 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. diff --git a/xml/System/DateTime.xml b/xml/System/DateTime.xml index 4168e33a3d6..61eba18e353 100644 --- a/xml/System/DateTime.xml +++ b/xml/System/DateTime.xml @@ -3672,11 +3672,11 @@ The return value is a whose p - If the value that is serialized represents an invalid time in the local time zone. In this case, the method adjusts the restored value so that it represents a valid time in the local time zone. - For example, the transition from standard time to daylight saving time occurs in the U.S. Pacific Time zone on March 14, 2010, at 2:00 A.M., when the time advances by one hour, to 3:00 A.M. This hour interval is an invalid time, that is, a time interval that does not exist in this time zone. The following example shows that when a time that falls within this range is converted to a long integer value by the method and is then restored by the method, the original value is adjusted to become a valid time. You can determine whether a particular date and time value may be subject to modification by passing it to the method, as the example illustrates. + For example, the transition from standard time to daylight saving time occurs in the U.S. Pacific Time zone on March 14, 2010, at 2:00 A.M., when the time advances by one hour, to 3:00 A.M. This hour interval is an invalid time, that is, a time interval that does not exist in this time zone. The following example shows that when a time that falls within this range is converted to a long integer value by the method and is then restored by the method, the original value is adjusted to become a valid time. You can determine whether a particular date and time value may be subject to modification by passing it to the method, as the example illustrates. - :::code language="csharp" source="~/snippets/csharp/System/DateTime/FromFileTime/fromfiletime1.cs" id="Snippet1"::: - :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.datetime.fromfiletime/fs/fromfiletime1.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/DateTime/FromFileTime/fromfiletime1.vb" id="Snippet1"::: + :::code language="csharp" source="~/snippets/csharp/System/DateTime/FromFileTime/fromfiletime1.cs" id="Snippet1"::: + :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.datetime.fromfiletime/fs/fromfiletime1.fs" id="Snippet1"::: + :::code language="vb" source="~/snippets/visualbasic/System/DateTime/FromFileTime/fromfiletime1.vb" id="Snippet1"::: @@ -5791,11 +5791,11 @@ The return value is a whose p - A string that includes the GMT designator and conforms to the RFC 1123 time format; for example: - "Sat, 01 Nov 2008 19:35:00 GMT" + "Sat, 01 Nov 2008 19:35:00 GMT" - A string that includes the date and time along with time zone offset information; for example: - "03/01/2009 05:42:00 -5:00" + "03/01/2009 05:42:00 -5:00" The following example parses strings in each of these formats by using the formatting conventions of the current culture, which in this case is the en-US culture: @@ -8333,11 +8333,11 @@ The return value is a whose p - If the value that is serialized represents an invalid time in the local time zone. In this case, the method adjusts the restored value so that it represents a valid time in the local time zone. - For example, the transition from standard time to daylight saving time occurs in the U.S. Pacific Time zone on March 14, 2010, at 2:00 A.M., when the time advances by one hour, to 3:00 A.M. This hour interval is an invalid time, that is, a time interval that does not exist in this time zone. The following example shows that when a time that falls within this range is converted to a long integer value by the method and is then restored by the method, the original value is adjusted to become a valid time. You can determine whether a particular date and time value may be subject to modification by passing it to the method, as the example illustrates. + For example, the transition from standard time to daylight saving time occurs in the U.S. Pacific Time zone on March 14, 2010, at 2:00 A.M., when the time advances by one hour, to 3:00 A.M. This hour interval is an invalid time, that is, a time interval that does not exist in this time zone. The following example shows that when a time that falls within this range is converted to a long integer value by the method and is then restored by the method, the original value is adjusted to become a valid time. You can determine whether a particular date and time value may be subject to modification by passing it to the method, as the example illustrates. - :::code language="csharp" source="~/snippets/csharp/System/DateTime/FromFileTime/fromfiletime1.cs" id="Snippet1"::: - :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.datetime.fromfiletime/fs/fromfiletime1.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/DateTime/FromFileTime/fromfiletime1.vb" id="Snippet1"::: + :::code language="csharp" source="~/snippets/csharp/System/DateTime/FromFileTime/fromfiletime1.cs" id="Snippet1"::: + :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.datetime.fromfiletime/fs/fromfiletime1.fs" id="Snippet1"::: + :::code language="vb" source="~/snippets/visualbasic/System/DateTime/FromFileTime/fromfiletime1.vb" id="Snippet1"::: diff --git a/xml/System/DateTimeOffset.xml b/xml/System/DateTimeOffset.xml index e36d0c1b3e5..b0c8fe3bdcf 100644 --- a/xml/System/DateTimeOffset.xml +++ b/xml/System/DateTimeOffset.xml @@ -130,19 +130,19 @@ - Date and time arithmetic. - You can add or subtract either dates or time intervals from a particular value. Arithmetic operations with values, unlike those with values, adjust for differences in time offsets when returning a result. For example, the following code uses variables to subtract the current local time from the current UTC time. The code then uses variables to perform the same operation. The subtraction with values returns the local time zone's difference from UTC, while the subtraction with values returns . + You can add or subtract either dates or time intervals from a particular value. Arithmetic operations with values, unlike those with values, adjust for differences in time offsets when returning a result. For example, the following code uses variables to subtract the current local time from the current UTC time. The code then uses variables to perform the same operation. The subtraction with values returns the local time zone's difference from UTC, while the subtraction with values returns . - :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/Overview/Type.cs" id="Snippet1"::: - :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Type/fs/Type.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/DateTimeOffset/Overview/Type.vb" id="Snippet1"::: + :::code language="csharp" source="~/snippets/csharp/System/DateTimeOffset/Overview/Type.cs" id="Snippet1"::: + :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.DateTimeOffset.Type/fs/Type.fs" id="Snippet1"::: + :::code language="vb" source="~/snippets/visualbasic/System/DateTimeOffset/Overview/Type.vb" id="Snippet1"::: - Type conversion operations. - You can convert values to values and vice versa. + You can convert values to values and vice versa. - Time manipulation and extraction operations. - 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. + 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`. @@ -150,11 +150,11 @@ - 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. - You can determine whether any particular value is earlier than, the same as, or later than another value. Before the comparison is performed, all values are converted to UTC. + You can determine whether any particular value is earlier than, the same as, or later than another value. Before the comparison is performed, all values are converted to UTC. ]]> diff --git a/xml/System/EntryPointNotFoundException.xml b/xml/System/EntryPointNotFoundException.xml index c4095c90012..c966ba8bc06 100644 --- a/xml/System/EntryPointNotFoundException.xml +++ b/xml/System/EntryPointNotFoundException.xml @@ -61,51 +61,51 @@ - The call to a function in a Windows DLL cannot be resolved because the function cannot be found. In the following example, an exception is thrown because User32.dll does not include a function named `GetMyNumber`. - :::code language="csharp" source="~/snippets/csharp/System/EntryPointNotFoundException/Overview/nofunction1.cs" id="Snippet1"::: - :::code language="fsharp" source="~/snippets/fsharp/System/EntryPointNotFoundException/Overview/nofunction1.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/EntryPointNotFoundException/Overview/nofunction1.vb" id="Snippet1"::: + :::code language="csharp" source="~/snippets/csharp/System/EntryPointNotFoundException/Overview/nofunction1.cs" id="Snippet1"::: + :::code language="fsharp" source="~/snippets/fsharp/System/EntryPointNotFoundException/Overview/nofunction1.fs" id="Snippet1"::: + :::code language="vb" source="~/snippets/visualbasic/System/EntryPointNotFoundException/Overview/nofunction1.vb" id="Snippet1"::: - The call to a function in a Windows DLL cannot be resolved because the name used in the method call does not match a name found in the assembly. Frequently, this occurs because the field is either implicitly or explicitly set to `true`, the called method includes one or more string parameters and has both an ANSI and a Unicode version, and the name used in the method call does not correspond to the name of this ANSI or Unicode version. The following example provides an illustration by attempting to call the Windows `MessageBox` function in User32.dll. Because the first method definition specifies for string marshaling, the common language looks for the wide-character version of the function, `MessageBoxW`, instead of the name used in the method call, `MessageBox`. The second method definition corrects this problem by calling the `MessageBoxW` instead of the `MessageBox` function. - :::code language="csharp" source="~/snippets/csharp/System/EntryPointNotFoundException/Overview/badcall1.cs" id="Snippet2"::: - :::code language="fsharp" source="~/snippets/fsharp/System/EntryPointNotFoundException/Overview/badcall1.fs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System/EntryPointNotFoundException/Overview/badcall1.vb" id="Snippet2"::: + :::code language="csharp" source="~/snippets/csharp/System/EntryPointNotFoundException/Overview/badcall1.cs" id="Snippet2"::: + :::code language="fsharp" source="~/snippets/fsharp/System/EntryPointNotFoundException/Overview/badcall1.fs" id="Snippet2"::: + :::code language="vb" source="~/snippets/visualbasic/System/EntryPointNotFoundException/Overview/badcall1.vb" id="Snippet2"::: - You're trying to call a function in a dynamic link library by its simple name rather than its decorated name. Typically, the C++ compiler generates a decorated name for DLL functions. For example, the following C++ code defines a function named `Double` in a library named TestDll.dll. - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.entrypointnotfoundexception.class/cpp/testdll.cpp" id="Snippet6"::: + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.entrypointnotfoundexception.class/cpp/testdll.cpp" id="Snippet6"::: - When the code in the following example tries to call the function, an exception is thrown because the `Double` function cannot be found. + When the code in the following example tries to call the function, an exception is thrown because the `Double` function cannot be found. - :::code language="csharp" source="~/snippets/csharp/System/EntryPointNotFoundException/Overview/mangle1.cs" id="Snippet7"::: - :::code language="fsharp" source="~/snippets/fsharp/System/EntryPointNotFoundException/Overview/mangle1.fs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/System/EntryPointNotFoundException/Overview/mangle1.vb" id="Snippet7"::: + :::code language="csharp" source="~/snippets/csharp/System/EntryPointNotFoundException/Overview/mangle1.cs" id="Snippet7"::: + :::code language="fsharp" source="~/snippets/fsharp/System/EntryPointNotFoundException/Overview/mangle1.fs" id="Snippet7"::: + :::code language="vb" source="~/snippets/visualbasic/System/EntryPointNotFoundException/Overview/mangle1.vb" id="Snippet7"::: - However, if the function is called by using its decorated name (in this case, `?Double@@YAHH@Z`), the function call succeeds, as the following example shows. + However, if the function is called by using its decorated name (in this case, `?Double@@YAHH@Z`), the function call succeeds, as the following example shows. - :::code language="csharp" source="~/snippets/csharp/System/EntryPointNotFoundException/Overview/mangle2.cs" id="Snippet8"::: - :::code language="fsharp" source="~/snippets/fsharp/System/EntryPointNotFoundException/Overview/mangle2.fs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/System/EntryPointNotFoundException/Overview/mangle2.vb" id="Snippet8"::: + :::code language="csharp" source="~/snippets/csharp/System/EntryPointNotFoundException/Overview/mangle2.cs" id="Snippet8"::: + :::code language="fsharp" source="~/snippets/fsharp/System/EntryPointNotFoundException/Overview/mangle2.fs" id="Snippet8"::: + :::code language="vb" source="~/snippets/visualbasic/System/EntryPointNotFoundException/Overview/mangle2.vb" id="Snippet8"::: - You can find the decorated names of functions exported by a DLL by using a utility such as Dumpbin.exe. + You can find the decorated names of functions exported by a DLL by using a utility such as Dumpbin.exe. - You are attempting to call a method in a managed assembly as if it were an unmanaged dynamic link library. To see this in action, compile the following example to an assembly named StringUtilities.dll. - :::code language="csharp" source="~/snippets/csharp/System/EntryPointNotFoundException/Overview/stringutilities.cs" id="Snippet3"::: - :::code language="fsharp" source="~/snippets/fsharp/System/EntryPointNotFoundException/Overview/stringutilities.fs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System/EntryPointNotFoundException/Overview/stringutilities.vb" id="Snippet3"::: + :::code language="csharp" source="~/snippets/csharp/System/EntryPointNotFoundException/Overview/stringutilities.cs" id="Snippet3"::: + :::code language="fsharp" source="~/snippets/fsharp/System/EntryPointNotFoundException/Overview/stringutilities.fs" id="Snippet3"::: + :::code language="vb" source="~/snippets/visualbasic/System/EntryPointNotFoundException/Overview/stringutilities.vb" id="Snippet3"::: - Then compile and execute the following example, which attempts to call the `StringUtilities.SayGoodMorning` method in the StringUtilities.dll dynamic link library as if it were unmanaged code. The result is an exception. + Then compile and execute the following example, which attempts to call the `StringUtilities.SayGoodMorning` method in the StringUtilities.dll dynamic link library as if it were unmanaged code. The result is an exception. - :::code language="csharp" source="~/snippets/csharp/System/EntryPointNotFoundException/Overview/importassembly1.cs" id="Snippet4"::: - :::code language="fsharp" source="~/snippets/fsharp/System/EntryPointNotFoundException/Overview/importassembly1.fs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System/EntryPointNotFoundException/Overview/importassembly1.vb" id="Snippet4"::: + :::code language="csharp" source="~/snippets/csharp/System/EntryPointNotFoundException/Overview/importassembly1.cs" id="Snippet4"::: + :::code language="fsharp" source="~/snippets/fsharp/System/EntryPointNotFoundException/Overview/importassembly1.fs" id="Snippet4"::: + :::code language="vb" source="~/snippets/visualbasic/System/EntryPointNotFoundException/Overview/importassembly1.vb" id="Snippet4"::: - To eliminate the exception, add a reference to the managed assembly and access the `StringUtilities.SayGoodMorning` method just as you would access any other method in managed code, as the following example does. + To eliminate the exception, add a reference to the managed assembly and access the `StringUtilities.SayGoodMorning` method just as you would access any other method in managed code, as the following example does. - :::code language="csharp" source="~/snippets/csharp/System/EntryPointNotFoundException/Overview/fiximportassembly1.cs" id="Snippet5"::: - :::code language="fsharp" source="~/snippets/fsharp/System/EntryPointNotFoundException/Overview/fiximportassembly1.fs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/System/EntryPointNotFoundException/Overview/fiximportassembly1.vb" id="Snippet5"::: + :::code language="csharp" source="~/snippets/csharp/System/EntryPointNotFoundException/Overview/fiximportassembly1.cs" id="Snippet5"::: + :::code language="fsharp" source="~/snippets/fsharp/System/EntryPointNotFoundException/Overview/fiximportassembly1.fs" id="Snippet5"::: + :::code language="vb" source="~/snippets/visualbasic/System/EntryPointNotFoundException/Overview/fiximportassembly1.vb" id="Snippet5"::: - You are trying to call a method in a COM DLL as if it were a Windows DLL. To access a COM DLL, select the **Add Reference** option in Visual Studio to add a reference to the project, and then select the type library from the **COM** tab. diff --git a/xml/System/GC.xml b/xml/System/GC.xml index 4262436d341..8c8ce1df143 100644 --- a/xml/System/GC.xml +++ b/xml/System/GC.xml @@ -1510,9 +1510,9 @@ The following example demonstrates the use of the interface - 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. 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`. (Note that the F# example does not handle `null` values for `Person` instances.) diff --git a/xml/System/IndexOutOfRangeException.xml b/xml/System/IndexOutOfRangeException.xml index c0717ab50b3..bdc0d8aeded 100644 --- a/xml/System/IndexOutOfRangeException.xml +++ b/xml/System/IndexOutOfRangeException.xml @@ -71,84 +71,82 @@ - Forgetting that the upper bound of a collection or a zero-based array is one less than its number of members or elements, as the following example illustrates. - :::code language="csharp" source="~/snippets/csharp/System/IndexOutOfRangeException/Overview/length1.cs" id="Snippet3"::: - :::code language="fsharp" source="~/snippets/fsharp/System/IndexOutOfRangeException/Overview/length1.fs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System/IndexOutOfRangeException/Overview/length1.vb" id="Snippet3"::: + :::code language="csharp" source="~/snippets/csharp/System/IndexOutOfRangeException/Overview/length1.cs" id="Snippet3"::: + :::code language="fsharp" source="~/snippets/fsharp/System/IndexOutOfRangeException/Overview/length1.fs" id="Snippet3"::: + :::code language="vb" source="~/snippets/visualbasic/System/IndexOutOfRangeException/Overview/length1.vb" id="Snippet3"::: - To correct the error, you can use code like the following. + To correct the error, you can use code like the following. - :::code language="csharp" source="~/snippets/csharp/System/IndexOutOfRangeException/Overview/length2.cs" id="Snippet4"::: - :::code language="fsharp" source="~/snippets/fsharp/System/IndexOutOfRangeException/Overview/length2.fs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/System/IndexOutOfRangeException/Overview/length2.vb" id="Snippet4"::: + :::code language="csharp" source="~/snippets/csharp/System/IndexOutOfRangeException/Overview/length2.cs" id="Snippet4"::: + :::code language="fsharp" source="~/snippets/fsharp/System/IndexOutOfRangeException/Overview/length2.fs" id="Snippet4"::: + :::code language="vb" source="~/snippets/visualbasic/System/IndexOutOfRangeException/Overview/length2.vb" id="Snippet4"::: - Alternately, instead of iterating all the elements in the array by their index, you can use the `foreach` statement (in C#), the `for...in` statement (in F#), or the `For Each` statement (in Visual Basic). + Alternately, instead of iterating all the elements in the array by their index, you can use the `foreach` statement (in C#), the `for...in` statement (in F#), or the `For Each` statement (in Visual Basic). - Attempting to assign an array element to another array that has not been adequately dimensioned and that has fewer elements than the original array. The following example attempts to assign the last element in the `value1` array to the same element in the `value2` array. However, the `value2` array has been incorrectly dimensioned to have six instead of seven elements. As a result, the assignment throws an exception. - :::code language="csharp" source="~/snippets/csharp/System/IndexOutOfRangeException/Overview/Uninit1.cs" id="Snippet10"::: - :::code language="fsharp" source="~/snippets/fsharp/System/IndexOutOfRangeException/Overview/Uninit1.fs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/System/IndexOutOfRangeException/Overview/Uninit1.vb" id="Snippet10"::: + :::code language="csharp" source="~/snippets/csharp/System/IndexOutOfRangeException/Overview/Uninit1.cs" id="Snippet10"::: + :::code language="fsharp" source="~/snippets/fsharp/System/IndexOutOfRangeException/Overview/Uninit1.fs" id="Snippet10"::: + :::code language="vb" source="~/snippets/visualbasic/System/IndexOutOfRangeException/Overview/Uninit1.vb" id="Snippet10"::: - Using a value returned by a search method to iterate a portion of an array or collection starting at a particular index position. If you forget to check whether the search operation found a match, the runtime throws an exception, as shown in this example. - :::code language="csharp" source="~/snippets/csharp/System/IndexOutOfRangeException/Overview/negative1.cs" id="Snippet5"::: - :::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"::: + :::code language="csharp" source="~/snippets/csharp/System/IndexOutOfRangeException/Overview/negative1.cs" id="Snippet5"::: + :::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"::: - :::code language="vb" source="~/snippets/visualbasic/System/IndexOutOfRangeException/Overview/negative2.vb" id="Snippet6"::: + :::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"::: + :::code language="vb" source="~/snippets/visualbasic/System/IndexOutOfRangeException/Overview/negative2.vb" id="Snippet6"::: - Trying to use or enumerate a result set, collection, or array returned by a query without testing whether the returned object has any valid data. - 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 following equation must be true for the dimension of the array that you want to iterate: - - 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. + ``` + start_index >= lower_bound And start_index + items_to_iterate - 1 <= upper_bound + ``` - - The following equation must be true for the dimension of the array that you want to iterate: + For a collection, the following equation must be true: - ``` - start_index >= lower_bound And start_index + items_to_iterate - 1 <= upper_bound - ``` + ``` + start_index >= 0 And start_index + items_to_iterate <= Count + ``` - For a collection, the following equation must be true: + > [!TIP] + > The starting index of an array or collection can never be a negative number. - ``` - start_index >= 0 And start_index + items_to_iterate <= Count - ``` +- 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. - > [!TIP] - > The starting index of an array or collection can never be a negative number. + :::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"::: -- 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. + 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/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"::: + :::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"::: - 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. - :::code language="csharp" source="~/snippets/csharp/System/IndexOutOfRangeException/Overview/foreach1.cs" id="Snippet7"::: - :::code language="fsharp" source="~/snippets/fsharp/System/IndexOutOfRangeException/Overview/foreach1.fs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/System/IndexOutOfRangeException/Overview/foreach1.vb" id="Snippet7"::: + :::code language="csharp" source="~/snippets/csharp/System/IndexOutOfRangeException/Overview/foreach1.cs" id="Snippet7"::: + :::code language="fsharp" source="~/snippets/fsharp/System/IndexOutOfRangeException/Overview/foreach1.fs" id="Snippet7"::: + :::code language="vb" source="~/snippets/visualbasic/System/IndexOutOfRangeException/Overview/foreach1.vb" id="Snippet7"::: - The iteration construct returns each value in an array or collection, not its index. To eliminate the exception, use this code. + The iteration construct returns each value in an array or collection, not its index. To eliminate the exception, use this code. - :::code language="csharp" source="~/snippets/csharp/System/IndexOutOfRangeException/Overview/foreach2.cs" id="Snippet8"::: - :::code language="fsharp" source="~/snippets/fsharp/System/IndexOutOfRangeException/Overview/foreach2.fs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/System/IndexOutOfRangeException/Overview/foreach2.vb" id="Snippet8"::: + :::code language="csharp" source="~/snippets/csharp/System/IndexOutOfRangeException/Overview/foreach2.cs" id="Snippet8"::: + :::code language="fsharp" source="~/snippets/fsharp/System/IndexOutOfRangeException/Overview/foreach2.fs" id="Snippet8"::: + :::code language="vb" source="~/snippets/visualbasic/System/IndexOutOfRangeException/Overview/foreach2.vb" id="Snippet8"::: - Providing an invalid column name to the property. @@ -167,9 +165,7 @@ The following intermediate language (IL) instructions throw : - ldelem.\ - - ldelema - - stelem.\ uses the HRESULT COR_E_INDEXOUTOFRANGE, which has the value 0x80131508. diff --git a/xml/System/IntPtr.xml b/xml/System/IntPtr.xml index 13084a44d0c..87f9f1329d9 100644 --- a/xml/System/IntPtr.xml +++ b/xml/System/IntPtr.xml @@ -278,13 +278,13 @@ 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. + 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. diff --git a/xml/System/InvalidOperationException.xml b/xml/System/InvalidOperationException.xml index a3b545c03fb..ae1940301a4 100644 --- a/xml/System/InvalidOperationException.xml +++ b/xml/System/InvalidOperationException.xml @@ -177,13 +177,13 @@ You can eliminate the exception in any of three ways: - If you cannot modify the source code for the type you are trying to sort, you can create a delegate to perform the sorting. The delegate signature is - ```vb + ```vb Function Comparison(Of T)(x As T, y As T) As Integer - ``` + ``` - ```csharp + ```csharp int Comparison(T x, T y) - ``` + ``` The following example uses the approach by defining a `PersonComparison` method that matches the delegate signature. It then passes this delegate to the method. diff --git a/xml/System/NullReferenceException.xml b/xml/System/NullReferenceException.xml index d46bf738bd3..e09656d6d32 100644 --- a/xml/System/NullReferenceException.xml +++ b/xml/System/NullReferenceException.xml @@ -73,85 +73,85 @@ A exception is thrown when you try to acces - You forgot to instantiate a reference type. In the following example, `names` is declared but never instantiated (the affected line is commented out in the C# example since it doesn't compile): - :::code language="csharp" source="~/snippets/csharp/System/NullReferenceException/Overview/example1.cs" id="Snippet1"::: - :::code language="fsharp" source="~/snippets/fsharp/System/NullReferenceException/Overview/example1.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/NullReferenceException/Overview/example1.vb" id="Snippet1"::: + :::code language="csharp" source="~/snippets/csharp/System/NullReferenceException/Overview/example1.cs" id="Snippet1"::: + :::code language="fsharp" source="~/snippets/fsharp/System/NullReferenceException/Overview/example1.fs" id="Snippet1"::: + :::code language="vb" source="~/snippets/visualbasic/System/NullReferenceException/Overview/example1.vb" id="Snippet1"::: - Some compilers issue a warning when they compile this code. Others issue an error, and the compilation fails. To address this problem, instantiate the object so that its value is no longer `null`. The following example does this by calling a type's class constructor. + Some compilers issue a warning when they compile this code. Others issue an error, and the compilation fails. To address this problem, instantiate the object so that its value is no longer `null`. The following example does this by calling a type's class constructor. - :::code language="csharp" source="~/snippets/csharp/System/NullReferenceException/Overview/example1a.cs" id="Snippet2"::: - :::code language="fsharp" source="~/snippets/fsharp/System/NullReferenceException/Overview/example1a.fs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System/NullReferenceException/Overview/example1a.vb" id="Snippet2"::: + :::code language="csharp" source="~/snippets/csharp/System/NullReferenceException/Overview/example1a.cs" id="Snippet2"::: + :::code language="fsharp" source="~/snippets/fsharp/System/NullReferenceException/Overview/example1a.fs" id="Snippet2"::: + :::code language="vb" source="~/snippets/visualbasic/System/NullReferenceException/Overview/example1a.vb" id="Snippet2"::: - You forgot to dimension an array before initializing it. In the following example, `values` is declared to be an integer array, but the number of elements that it contains is never specified. The attempt to initialize its values therefore throws a exception. - :::code language="csharp" source="~/snippets/csharp/System/NullReferenceException/Overview/Array3.cs" id="Snippet10"::: - :::code language="fsharp" source="~/snippets/fsharp/System/NullReferenceException/Overview/Array3.fs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/System/NullReferenceException/Overview/Array3.vb" id="Snippet10"::: + :::code language="csharp" source="~/snippets/csharp/System/NullReferenceException/Overview/Array3.cs" id="Snippet10"::: + :::code language="fsharp" source="~/snippets/fsharp/System/NullReferenceException/Overview/Array3.fs" id="Snippet10"::: + :::code language="vb" source="~/snippets/visualbasic/System/NullReferenceException/Overview/Array3.vb" id="Snippet10"::: - You can eliminate the exception by declaring the number of elements in the array before initializing it, as the following example does. + You can eliminate the exception by declaring the number of elements in the array before initializing it, as the following example does. - :::code language="csharp" source="~/snippets/csharp/System/NullReferenceException/Overview/Array4.cs" id="Snippet11"::: - :::code language="fsharp" source="~/snippets/fsharp/System/NullReferenceException/Overview/Array4.fs" id="Snippet11"::: - :::code language="vb" source="~/snippets/visualbasic/System/NullReferenceException/Overview/Array4.vb" id="Snippet11"::: + :::code language="csharp" source="~/snippets/csharp/System/NullReferenceException/Overview/Array4.cs" id="Snippet11"::: + :::code language="fsharp" source="~/snippets/fsharp/System/NullReferenceException/Overview/Array4.fs" id="Snippet11"::: + :::code language="vb" source="~/snippets/visualbasic/System/NullReferenceException/Overview/Array4.vb" id="Snippet11"::: - For more information on declaring and initializing arrays, see [Arrays](/dotnet/csharp/language-reference/builtin-types/arrays) and [Arrays](/dotnet/visual-basic/programming-guide/language-features/arrays/). + For more information on declaring and initializing arrays, see [Arrays](/dotnet/csharp/language-reference/builtin-types/arrays) and [Arrays](/dotnet/visual-basic/programming-guide/language-features/arrays/). - 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"::: - :::code language="vb" source="~/snippets/visualbasic/System/NullReferenceException/Overview/nullreturn2.vb" id="Snippet4"::: + :::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"::: + :::code language="vb" source="~/snippets/visualbasic/System/NullReferenceException/Overview/nullreturn2.vb" id="Snippet4"::: - To address this problem, test the method's return value to ensure that it's not `null` before calling any of its members, as the following example does. + To address this problem, test the method's return value to ensure that it's not `null` before calling any of its members, as the following example does. - :::code language="csharp" source="~/snippets/csharp/System/NullReferenceException/Overview/nullreturn2.cs" id="Snippet5"::: - :::code language="fsharp" source="~/snippets/fsharp/System/NullReferenceException/Overview/nullreturn2a.fs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/System/NullReferenceException/Overview/nullreturn2a.vb" id="Snippet5"::: + :::code language="csharp" source="~/snippets/csharp/System/NullReferenceException/Overview/nullreturn2.cs" id="Snippet5"::: + :::code language="fsharp" source="~/snippets/fsharp/System/NullReferenceException/Overview/nullreturn2a.fs" id="Snippet5"::: + :::code language="vb" source="~/snippets/visualbasic/System/NullReferenceException/Overview/nullreturn2a.vb" id="Snippet5"::: - You're using an expression (for example, you chained a list of methods or properties together) to retrieve a value and, although you're checking whether the value is `null`, the runtime still throws a exception. This occurs because one of the intermediate values in the expression returns `null`. As a result, your test for `null` is never evaluated. - The following example defines a `Pages` object that caches information about web pages, which are presented by `Page` objects. The `Example.Main` method checks whether the current web page has a non-null title and, if it does, displays the title. Despite this check, however, the method throws a exception. + The following example defines a `Pages` object that caches information about web pages, which are presented by `Page` objects. The `Example.Main` method checks whether the current web page has a non-null title and, if it does, displays the title. Despite this check, however, the method throws a exception. - :::code language="csharp" source="~/snippets/csharp/System/NullReferenceException/Overview/Chain1.cs" id="Snippet6"::: - :::code language="fsharp" source="~/snippets/fsharp/System/NullReferenceException/Overview/Chain1.fs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/System/NullReferenceException/Overview/Chain1.vb" id="Snippet6"::: + :::code language="csharp" source="~/snippets/csharp/System/NullReferenceException/Overview/Chain1.cs" id="Snippet6"::: + :::code language="fsharp" source="~/snippets/fsharp/System/NullReferenceException/Overview/Chain1.fs" id="Snippet6"::: + :::code language="vb" source="~/snippets/visualbasic/System/NullReferenceException/Overview/Chain1.vb" id="Snippet6"::: - The exception is thrown because `pages.CurrentPage` returns `null` if no page information is stored in the cache. This exception can be corrected by testing the value of the `CurrentPage` property before retrieving the current `Page` object's `Title` property, as the following example does: + The exception is thrown because `pages.CurrentPage` returns `null` if no page information is stored in the cache. This exception can be corrected by testing the value of the `CurrentPage` property before retrieving the current `Page` object's `Title` property, as the following example does: - :::code language="csharp" source="~/snippets/csharp/System/NullReferenceException/Overview/Chain2.cs" id="Snippet7"::: - :::code language="fsharp" source="~/snippets/fsharp/System/NullReferenceException/Overview/Chain2.fs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/System/NullReferenceException/Overview/Chain2.vb" id="Snippet7"::: + :::code language="csharp" source="~/snippets/csharp/System/NullReferenceException/Overview/Chain2.cs" id="Snippet7"::: + :::code language="fsharp" source="~/snippets/fsharp/System/NullReferenceException/Overview/Chain2.fs" id="Snippet7"::: + :::code language="vb" source="~/snippets/visualbasic/System/NullReferenceException/Overview/Chain2.vb" id="Snippet7"::: - 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"::: - :::code language="vb" source="~/snippets/visualbasic/System/NullReferenceException/Overview/Array1.vb" id="Snippet8"::: + :::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"::: + :::code language="vb" source="~/snippets/visualbasic/System/NullReferenceException/Overview/Array1.vb" id="Snippet8"::: - This exception occurs if you assume that each element of the array must contain a non-null value, and the value of the array element is in fact `null`. The exception can be eliminated by testing whether the element is `null` before performing any operation on that element, as the following example shows. + This exception occurs if you assume that each element of the array must contain a non-null value, and the value of the array element is in fact `null`. The exception can be eliminated by testing whether the element is `null` before performing any operation on that element, as the following example shows. - :::code language="csharp" source="~/snippets/csharp/System/NullReferenceException/Overview/Array2.cs" id="Snippet9"::: - :::code language="fsharp" source="~/snippets/fsharp/System/NullReferenceException/Overview/Array2.fs" id="Snippet9"::: - :::code language="vb" source="~/snippets/visualbasic/System/NullReferenceException/Overview/Array2.vb" id="Snippet9"::: + :::code language="csharp" source="~/snippets/csharp/System/NullReferenceException/Overview/Array2.cs" id="Snippet9"::: + :::code language="fsharp" source="~/snippets/fsharp/System/NullReferenceException/Overview/Array2.fs" id="Snippet9"::: + :::code language="vb" source="~/snippets/visualbasic/System/NullReferenceException/Overview/Array2.vb" id="Snippet9"::: - A method when it accesses a member of one of its arguments, but that argument is `null`. The `PopulateNames` method in the following example throws the exception at the line `names.Add(arrName);`. - :::code language="csharp" source="~/snippets/csharp/System/NullReferenceException/Overview/example2.cs" id="Snippet3"::: - :::code language="fsharp" source="~/snippets/fsharp/System/NullReferenceException/Overview/example2.fs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System/NullReferenceException/Overview/example2.vb" id="Snippet3"::: + :::code language="csharp" source="~/snippets/csharp/System/NullReferenceException/Overview/example2.cs" id="Snippet3"::: + :::code language="fsharp" source="~/snippets/fsharp/System/NullReferenceException/Overview/example2.fs" id="Snippet3"::: + :::code language="vb" source="~/snippets/visualbasic/System/NullReferenceException/Overview/example2.vb" id="Snippet3"::: - To address this issue, make sure that the argument passed to the method is not `null`, or handle the thrown exception in a `try…catch…finally` block. For more information, see [Exceptions](/dotnet/standard/exceptions/). + To address this issue, make sure that the argument passed to the method is not `null`, or handle the thrown exception in a `try…catch…finally` block. For more information, see [Exceptions](/dotnet/standard/exceptions/). - A list is created without knowing the type, and the list was not initialized. The `GetList` method in the following example throws the exception at the line `emptyList.Add(value)`. - :::code language="csharp" source="~/snippets/csharp/System/NullReferenceException/Overview/example3.cs" id="Snippet12"::: + :::code language="csharp" source="~/snippets/csharp/System/NullReferenceException/Overview/example3.cs" id="Snippet12"::: - To address this issue, make sure that the list is initialized (one way to do this is to call `Activator.CreateInstance` instead of `FormatterServices.GetUninitializedObject`), or handle the thrown exception in a `try…catch…finally` block. For more information, see [Exceptions](/dotnet/standard/exceptions/). + To address this issue, make sure that the list is initialized (one way to do this is to call `Activator.CreateInstance` instead of `FormatterServices.GetUninitializedObject`), or handle the thrown exception in a `try…catch…finally` block. For more information, see [Exceptions](/dotnet/standard/exceptions/). The following Microsoft intermediate language (MSIL) instructions throw : `callvirt`, `cpblk`, `cpobj`, `initblk`, `ldelem.`, `ldelema`, `ldfld`, `ldflda`, `ldind.`, `ldlen`, `stelem.`, `stfld`, `stind.`, `throw`, and `unbox`. diff --git a/xml/System/Object.xml b/xml/System/Object.xml index 236f43fcc4a..2a3b01fc8a5 100644 --- a/xml/System/Object.xml +++ b/xml/System/Object.xml @@ -896,19 +896,19 @@ To illustrate the difference between a shallow and a deep copy operation, consid - 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"::: - :::code language="vb" source="~/snippets/visualbasic/System/Object/ReferenceEquals/referenceequals4.vb" id="Snippet1"::: + :::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"::: + :::code language="vb" source="~/snippets/visualbasic/System/Object/ReferenceEquals/referenceequals4.vb" id="Snippet1"::: - For information on boxing value types, see [Boxing and Unboxing](/dotnet/csharp/programming-guide/types/boxing-and-unboxing). + 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. - :::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"::: + :::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 . diff --git a/xml/System/ObjectDisposedException.xml b/xml/System/ObjectDisposedException.xml index 23adfe53df1..6a8d14da8f2 100644 --- a/xml/System/ObjectDisposedException.xml +++ b/xml/System/ObjectDisposedException.xml @@ -63,9 +63,9 @@ - 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"::: + :::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 ``. diff --git a/xml/System/OutOfMemoryException.xml b/xml/System/OutOfMemoryException.xml index bdae1b80fc3..bc42bd66a20 100644 --- a/xml/System/OutOfMemoryException.xml +++ b/xml/System/OutOfMemoryException.xml @@ -79,11 +79,11 @@ 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"::: - :::code language="vb" source="~/snippets/visualbasic/System/OutOfMemoryException/Overview/failfast1.vb" id="Snippet2"::: + :::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"::: + :::code language="vb" source="~/snippets/visualbasic/System/OutOfMemoryException/Overview/failfast1.vb" id="Snippet2"::: Some of the conditions under which the exception is thrown and the actions you can take to eliminate it include the following: diff --git a/xml/System/OverflowException.xml b/xml/System/OverflowException.xml index ebd6defd757..4791c07f76d 100644 --- a/xml/System/OverflowException.xml +++ b/xml/System/OverflowException.xml @@ -63,15 +63,15 @@ - An arithmetic operation produces a result that is outside the range of the data type returned by the operation. The following example illustrates the that is thrown by a multiplication operation that overflows the bounds of the type. - :::code language="csharp" source="~/snippets/csharp/System/OverflowException/Overview/arithmetic1.cs" id="Snippet1"::: - :::code language="fsharp" source="~/snippets/fsharp/System/OverflowException/Overview/arithmetic1.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/System/OverflowException/Overview/arithmetic1.vb" id="Snippet1"::: + :::code language="csharp" source="~/snippets/csharp/System/OverflowException/Overview/arithmetic1.cs" id="Snippet1"::: + :::code language="fsharp" source="~/snippets/fsharp/System/OverflowException/Overview/arithmetic1.fs" id="Snippet1"::: + :::code language="vb" source="~/snippets/visualbasic/System/OverflowException/Overview/arithmetic1.vb" id="Snippet1"::: - A casting or conversion operation attempts to perform a narrowing conversion, and the value of the source data type is outside the range of the target data type. The following example illustrates the that is thrown by the attempt to convert a large unsigned byte value to a signed byte value. - :::code language="csharp" source="~/snippets/csharp/System/OverflowException/Overview/arithmetic1.cs" id="Snippet2"::: - :::code language="fsharp" source="~/snippets/fsharp/System/OverflowException/Overview/arithmetic1.fs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System/OverflowException/Overview/arithmetic1.vb" id="Snippet2"::: + :::code language="csharp" source="~/snippets/csharp/System/OverflowException/Overview/arithmetic1.cs" id="Snippet2"::: + :::code language="fsharp" source="~/snippets/fsharp/System/OverflowException/Overview/arithmetic1.fs" id="Snippet2"::: + :::code language="vb" source="~/snippets/visualbasic/System/OverflowException/Overview/arithmetic1.vb" id="Snippet2"::: In each case, the result of the operation is a value that is less than the `MinValue` property or greater than the `MaxValue` property of the data type that results from the operation. diff --git a/xml/System/String.xml b/xml/System/String.xml index ec5c43a4640..051f6bdb669 100644 --- a/xml/System/String.xml +++ b/xml/System/String.xml @@ -284,14 +284,14 @@ Casing operations can be based on the rules of the current culture, a specified - Differences in case mappings between the invariant culture and all other cultures. In these cases, using the casing rules of the invariant culture to change a character to uppercase or lowercase returns the same character. For all other cultures, it returns a different character. Some of the affected characters are listed in the following table. - |Character|If changed to|Returns| - |---------------|-------------------|-------------| - |MICRON SIGN (U+00B5)|Uppercase|GREEK CAPITAL LETTER MU (U+-39C)| - |LATIN CAPITAL LETTER I WITH DOT ABOVE (U+0130)|Lowercase|LATIN SMALL LETTER I (U+0069)| - |LATIN SMALL LETTER DOTLESS I (U+0131)|Uppercase|LATIN CAPITAL LETTER I (U+0049)| - |LATIN SMALL LETTER LONG S (U+017F)|Uppercase|LATIN CAPITAL LETTER S (U+0053)| - |LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON (U+01C5)|Lowercase|LATIN SMALL LETTER DZ WITH CARON (U+01C6)| - |COMBINING GREEK YPOGEGRAMMENI (U+0345)|Uppercase|GREEK CAPITAL LETTER IOTA (U+0399)| + |Character|If changed to|Returns| + |---------------|-------------------|-------------| + |MICRON SIGN (U+00B5)|Uppercase|GREEK CAPITAL LETTER MU (U+-39C)| + |LATIN CAPITAL LETTER I WITH DOT ABOVE (U+0130)|Lowercase|LATIN SMALL LETTER I (U+0069)| + |LATIN SMALL LETTER DOTLESS I (U+0131)|Uppercase|LATIN CAPITAL LETTER I (U+0049)| + |LATIN SMALL LETTER LONG S (U+017F)|Uppercase|LATIN CAPITAL LETTER S (U+0053)| + |LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON (U+01C5)|Lowercase|LATIN SMALL LETTER DZ WITH CARON (U+01C6)| + |COMBINING GREEK YPOGEGRAMMENI (U+0345)|Uppercase|GREEK CAPITAL LETTER IOTA (U+0399)| - Differences in case mappings of two-letter mixed-case pairs in the ASCII character range. In most cultures, a two-letter mixed-case pair is equal to the equivalent two-letter uppercase or lowercase pair. This is not true for the following two-letter pairs in the following cultures, because in each case they are compared to a digraph: @@ -14720,15 +14720,15 @@ If the substring should extend from `startIndex` to a specified character sequen - 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"::: + :::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. - :::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"::: + :::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. diff --git a/xml/System/TimeSpan.xml b/xml/System/TimeSpan.xml index d6f34f5ab73..0e85d0341d9 100644 --- a/xml/System/TimeSpan.xml +++ b/xml/System/TimeSpan.xml @@ -139,7 +139,7 @@ You can instantiate a value in a number of ways: :::code language="fsharp" source="~/snippets/fsharp/System/TimeSpan/Overview/zero1.fs" id="Snippet6"::: :::code language="vb" source="~/snippets/visualbasic/System/TimeSpan/Overview/zero1.vb" id="Snippet6"::: - values are returned by arithmetic operators and methods of the , , and structures. + values are returned by arithmetic operators and methods of the , , and structures. - By parsing the string representation of a value. You can use the and methods to convert strings that contain time intervals to values. The following example uses the method to convert an array of strings to values. diff --git a/xml/System/Tuple`2.xml b/xml/System/Tuple`2.xml index 384350d2079..c60f9b0a1d3 100644 --- a/xml/System/Tuple`2.xml +++ b/xml/System/Tuple`2.xml @@ -105,15 +105,15 @@ - 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"::: + :::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. - :::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"::: + :::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. diff --git a/xml/System/Tuple`3.xml b/xml/System/Tuple`3.xml index 6ecdcccdbc6..c6064c1865f 100644 --- a/xml/System/Tuple`3.xml +++ b/xml/System/Tuple`3.xml @@ -114,9 +114,9 @@ - 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"::: + :::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. diff --git a/xml/System/Tuple`4.xml b/xml/System/Tuple`4.xml index adc73534e86..887165ff8cb 100644 --- a/xml/System/Tuple`4.xml +++ b/xml/System/Tuple`4.xml @@ -123,9 +123,9 @@ - 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"::: + :::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. diff --git a/xml/System/Tuple`5.xml b/xml/System/Tuple`5.xml index 1e24a87df2a..af13290561c 100644 --- a/xml/System/Tuple`5.xml +++ b/xml/System/Tuple`5.xml @@ -132,9 +132,9 @@ - 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"::: + :::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. diff --git a/xml/System/Tuple`6.xml b/xml/System/Tuple`6.xml index 5593ba51b1d..00b56ec83bd 100644 --- a/xml/System/Tuple`6.xml +++ b/xml/System/Tuple`6.xml @@ -141,9 +141,9 @@ - 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"::: + :::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. diff --git a/xml/System/Tuple`7.xml b/xml/System/Tuple`7.xml index 30698adf694..76f11a1fec4 100644 --- a/xml/System/Tuple`7.xml +++ b/xml/System/Tuple`7.xml @@ -150,9 +150,9 @@ - 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"::: + :::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. diff --git a/xml/System/Type.xml b/xml/System/Type.xml index 67894475b71..32f5683d7f8 100644 --- a/xml/System/Type.xml +++ b/xml/System/Type.xml @@ -1609,29 +1609,29 @@ 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"::: - :::code language="vb" source="~/snippets/visualbasic/System/Type/FullName/Fullname3.vb" id="Snippet3"::: + :::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"::: + :::code language="vb" source="~/snippets/visualbasic/System/Type/FullName/Fullname3.vb" id="Snippet3"::: - The current 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"::: - :::code language="vb" source="~/snippets/visualbasic/System/Type/FullName/FullName4.vb" id="Snippet4"::: + :::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"::: + :::code language="vb" source="~/snippets/visualbasic/System/Type/FullName/FullName4.vb" id="Snippet4"::: - The current type contains generic type parameters that have not been replaced by specific types (that is, the property returns `true`), but the type is not a generic type definition (that is, the property returns `false` - In the following example, `Derived` inherits from `Base`. The property obtains the object that represents the base type of `Derived`, and its property returns `null`. + In the following example, `Derived` inherits from `Base`. The property obtains the object that represents the base type of `Derived`, and its property returns `null`. - :::code language="csharp" source="~/snippets/csharp/System/Type/FullName/Fullname5.cs" id="Snippet5"::: - :::code language="fsharp" source="~/snippets/fsharp/System/Type/FullName/Fullname5.fs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/System/Type/FullName/FullName5.vb" id="Snippet5"::: + :::code language="csharp" source="~/snippets/csharp/System/Type/FullName/Fullname5.cs" id="Snippet5"::: + :::code language="fsharp" source="~/snippets/fsharp/System/Type/FullName/Fullname5.fs" id="Snippet5"::: + :::code language="vb" source="~/snippets/visualbasic/System/Type/FullName/FullName5.vb" id="Snippet5"::: - To get a 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. diff --git a/xml/System/TypeInitializationException.xml b/xml/System/TypeInitializationException.xml index fe0d550654f..c2025ecda5e 100644 --- a/xml/System/TypeInitializationException.xml +++ b/xml/System/TypeInitializationException.xml @@ -90,7 +90,7 @@ Most commonly, a exception is thrown w - The type has `static` (in C# or F#) or `Shared` (in Visual Basic) variables that are declared and initialized in a single statement. In this case, the language compiler generates a static constructor for the type. For instance, when the C# and VB compilers compile the following example, they generate the IL for a static constructor that is similar to this: - ```il + ```il .method private specialname rtspecialname static void .cctor() cil managed { @@ -101,7 +101,7 @@ Most commonly, a exception is thrown w IL_0006: stsfld class TestClass Example::test IL_000b: ret } // end of method Example::.cctor - ``` + ``` The following example shows a exception thrown by a compiler-generated static constructor. The `Example` class includes a `static` (in C#) or `Shared` (in Visual Basic) field of type `TestClass` that is instantiated by passing a value of 3 to its class constructor. That value, however, is illegal; only values of 0 or 1 are permitted. As a result, the `TestClass` class constructor throws an . Since this exception is not handled, it is wrapped in a exception. From d2cac158259867c8fe1866bf57c52b303633f9fd Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Thu, 18 Jun 2026 13:00:32 -0700 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> --- xml/System.Speech.Synthesis.TtsEngine/SpeechEventInfo.xml | 2 +- xml/System.Speech.Synthesis.TtsEngine/TtsEngineSsml.xml | 2 +- xml/System.Threading/ThreadPool.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xml/System.Speech.Synthesis.TtsEngine/SpeechEventInfo.xml b/xml/System.Speech.Synthesis.TtsEngine/SpeechEventInfo.xml index 3e5a2706232..cbc2e69bcbf 100644 --- a/xml/System.Speech.Synthesis.TtsEngine/SpeechEventInfo.xml +++ b/xml/System.Speech.Synthesis.TtsEngine/SpeechEventInfo.xml @@ -43,7 +43,7 @@ ## Examples The example below is part of a custom speech synthesis implementation inheriting from , and using the use of , , , and -The implementation of :: +The implementation of : 1. Receives an array of instances and creates a new array of instances to be passed to the `Speak` method on an underlying synthesis engine. diff --git a/xml/System.Speech.Synthesis.TtsEngine/TtsEngineSsml.xml b/xml/System.Speech.Synthesis.TtsEngine/TtsEngineSsml.xml index 341c5ea4954..1b74aec9d4c 100644 --- a/xml/System.Speech.Synthesis.TtsEngine/TtsEngineSsml.xml +++ b/xml/System.Speech.Synthesis.TtsEngine/TtsEngineSsml.xml @@ -44,7 +44,7 @@ The method is called by the infrastructures text parser receiving: -1. A reference to the interface, which provides access to system services such as even queuing and writing audio output. +1. A reference to the interface, which provides access to system services such as event queuing and writing audio output. 2. An array of instance produced from Speech Synthesis Markup Language (SSML) input. In addition to text to be rendered as speech, the parsing of the SSML stores information about the requested attributes of the speech in a instance associated with each incoming object. diff --git a/xml/System.Threading/ThreadPool.xml b/xml/System.Threading/ThreadPool.xml index b593b0799a4..9ac41e9c48d 100644 --- a/xml/System.Threading/ThreadPool.xml +++ b/xml/System.Threading/ThreadPool.xml @@ -64,7 +64,7 @@ - When you use registered wait handles, a system thread monitors the status of the wait handles. When a wait operation completes, a worker thread from the thread pool executes the corresponding callback function. -- When you call the method to queue a method for execution on a thread pool thread. You do this by passing the method a delegate. The delegate has the signature `void WaitCallback(Object state)`, where `state` is an object that contains data to be used by the delegate. The actual data can be passed to the delegate by calling the method. +- When you call the method to queue a method for execution on a thread pool thread. You do this by passing the method a delegate. The delegate has the signature `void WaitCallback(object state)`, where `state` is an object that contains data to be used by the delegate. The actual data can be passed to the delegate by calling the method. > [!NOTE] > The threads in the managed thread pool are background threads. That is, their properties are `true`. This means that a thread will not keep an application running after all foreground threads have exited. From 59642028060972ace3111b06ac7ae1a6128081e9 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Thu, 18 Jun 2026 13:02:04 -0700 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> --- xml/System/GC.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xml/System/GC.xml b/xml/System/GC.xml index 8c8ce1df143..46eb2b22fad 100644 --- a/xml/System/GC.xml +++ b/xml/System/GC.xml @@ -1510,7 +1510,7 @@ The following example demonstrates the use of the