From 788bf562df19233a327e7c70e9e41dd3a7d90f41 Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Wed, 23 Apr 2025 15:14:41 +0200 Subject: [PATCH 01/16] Document WinHttpHandler trailer support (#11197) --- xml/System.Net.Http/WinHttpHandler.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xml/System.Net.Http/WinHttpHandler.xml b/xml/System.Net.Http/WinHttpHandler.xml index 318523207c0..13d3f0dfc25 100644 --- a/xml/System.Net.Http/WinHttpHandler.xml +++ b/xml/System.Net.Http/WinHttpHandler.xml @@ -55,6 +55,15 @@ This class is also available for use in Desktop apps by installing it as a NuGet Starting in .NET 5, is no longer included in the *System.Net.Http.dll* assembly as part of the .NET runtime. For more information, see [WinHttpHandler removed from .NET runtime](/dotnet/core/compatibility/3.1-5.0#winhttphandler-removed-from-net-runtime). +### Trailing headers + +Starting with version 6.0.0, supports trailing headers, also known as trailers ([RFC 7230 - 4.1.2. Chunked Trailer Part](https://tools.ietf.org/html/rfc7230#section-4.1.2)). + +- On .NET Standard 2.1 and .NET 8 or later, trailers are added to . +- On .NET Framework, trailers are added to a well-known property in on the request object corresponding to the response (). The name of the property is `__ResponseTrailers`, the type of the property value is . + +Trailer support is implemented via the `WINHTTP_QUERY_FLAG_TRAILERS` [Query Info Flag](/windows/win32/winhttp/query-info-flags) which has been introduced in Windows 11, version 21H2 (10.0; Build 22000). On Windows systems where `WINHTTP_QUERY_FLAG_TRAILERS` is unsupported, trailers are ignored. + ]]> From 8965ddbe3bfb8fd9f7668fcf9369e6d8d9ac7038 Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Wed, 23 Apr 2025 15:27:33 +0200 Subject: [PATCH 02/16] Extend TFO docs (#11196) --- xml/System.Net.Sockets/SocketOptionName.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xml/System.Net.Sockets/SocketOptionName.xml b/xml/System.Net.Sockets/SocketOptionName.xml index 8f8c09ab7d4..1f22cc68d9c 100644 --- a/xml/System.Net.Sockets/SocketOptionName.xml +++ b/xml/System.Net.Sockets/SocketOptionName.xml @@ -741,8 +741,7 @@ 15 - Enables TCP Fast Open as defined in RFC-7413. The actual observed behavior depends on OS configuration and the state of the kernel TCP cookie cache. - Enabling TFO can impact interoperability and cause connectivity issues. + Enables TCP Fast Open as defined in RFC-7413. The actual observed behavior depends on OS configuration and the state of the kernel TCP cookie cache. Using TFO is only recommended in controlled networking environments, meaning that each middlebox (for example, firewall, router, proxy) on the networking path between the client and server is known and can be configured to support TFO. Using TFO outside of controlled environments (such as the open internet) can lead to connectivity issues. From 037af0181e19cd2a95db61cf42738c387ec9407e Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Wed, 23 Apr 2025 15:48:33 +0200 Subject: [PATCH 03/16] Clarify CookieContainer thread-safety (#11171) * Clarify CookieContainer thread-safety * better text * Apply suggestions from code review Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> * Use remarks section only * Update xml/System.Net/CookieContainer.xml --------- Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> --- xml/System.Net/CookieContainer.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xml/System.Net/CookieContainer.xml b/xml/System.Net/CookieContainer.xml index b100c661b97..76bf26cfa53 100644 --- a/xml/System.Net/CookieContainer.xml +++ b/xml/System.Net/CookieContainer.xml @@ -77,6 +77,14 @@ The has three properties that govern the volume of the content of the container: , , and . These values have the default settings of 300, 4096, and 20 respectively. When a is added to the container, these properties are used to determine whether a already contained in the should be discarded to make room for the new one. The keeps track of each addition to ensure that neither the nor the limits are exceeded. If one or both are exceeded, then instances held by the are removed. First, any expired is removed. If further capacity must be recaptured, then the least-recently used is purged. +## Thread Safety + + The methods for adding and retrieving instances to and from a are thread-safe and can be used concurrently from multiple threads. + + > [!NOTE] + > Regardless of thread-safety, unanticipated sharing of instances can lead to issues when working with and or , since parts of the application that aren't intended to share cookies with each other might inadvertently do so. + > It is not recommended to use cookies together with . + ]]> From 098cd84b6f832f63136ea627ececa018bb156ea9 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 23 Apr 2025 07:11:12 -0700 Subject: [PATCH 04/16] Add policy to close empty issues (#11213) --- .github/policies/close-issues.yml | 87 ++++++++++++++++++++++++++++++- 1 file changed, 85 insertions(+), 2 deletions(-) diff --git a/.github/policies/close-issues.yml b/.github/policies/close-issues.yml index f068fad501b..0f20a8ab1d6 100644 --- a/.github/policies/close-issues.yml +++ b/.github/policies/close-issues.yml @@ -1,10 +1,41 @@ name: Close issues -description: Close issues based on label. +description: Close issues based on label resource: repository where: configuration: resourceManagementConfiguration: - eventResponderTasks: + scheduledSearches: + - frequencies: + - daily: + time: 12:00 + filters: + - isIssue + - isOpen + - hasLabel: + label: needs-more-info + - noActivitySince: + days: 14 + actions: + - addReply: + reply: This issue has been automatically closed due to no response from the original author. Feel free to reopen it if you have more information that can help us investigate the issue further. + - closeIssue + + eventResponderTasks: + - description: Remove needs-more-info label when author comments on issue + if: + - payloadType: Issue_Comment + - isAction: + action: Created + - isActivitySender: + issueAuthor: True + - hasLabel: + label: needs-more-info + - isOpen + then: + - removeLabel: + label: needs-more-info + triggerOnOwnActions: true + - description: Close issues labeled 'code-of-conduct' if: - payloadType: Issues @@ -12,3 +43,55 @@ configuration: label: code-of-conduct then: - closeIssue + + - description: Close learn template issues with empty descriptions (spam). + if: + - payloadType: Issues + - or: + - bodyContains: + pattern: '### Description[\n\r]+\[Enter feedback here\][\n\r]+###' + isRegex: True + - bodyContains: + pattern: '### Description[\n\r]+\[Escriba sus comentarios aquí][\n\r]+###' + isRegex: True + - bodyContains: + pattern: '### Description[\n\r]+\[Tapez vos commentaires ici][\n\r]+###' + isRegex: True + - bodyContains: + pattern: '### Description[\n\r]+\[Hier Feedback eingeben][\n\r]+###' + isRegex: true + - bodyContains: + pattern: '### Description[\n\r]+\[Geri bildiriminizi buraya girin][\n\r]+###' + isRegex: True + - bodyContains: + pattern: '### Description[\n\r]+\[Ketikkan umpan balik di sini][\n\r]+###' + isRegex: True + - bodyContains: + pattern: '### Description[\n\r]+\[Immetti qui i commenti][\n\r]+###' + isRegex: True + - bodyContains: + pattern: '### Description[\n\r]+\[Voer hier feedback in][\n\r]+###' + isRegex: True + - bodyContains: + pattern: '### Description[\n\r]+\[Insira comentários aqui][\n\r]+###' + isRegex: True + - bodyContains: + pattern: '### Description[\n\r]+\[Введите отзыв здесь][\n\r]+###' + isRegex: True + - bodyContains: + pattern: '### Description[\n\r]+\[اكتب ملاحظاتك هنا][\n\r]+###' + isRegex: True + - bodyContains: + pattern: '### Description[\n\r]+\[在此处输入反馈][\n\r]+###' + isRegex: True + - bodyContains: + pattern: '### Description[\n\r]+\[여기에 피드백 입력][\n\r]+###' + isRegex: True + - bodyContains: + pattern: '### Description[\n\r]+\[フィードバックをこちらに入力してください][\n\r]+###' + isRegex: True + then: + - addLabel: 'needs-more-info' + - addReply: + reply: This issue has been automatically closed due to an empty issue description from the original author. Feel free to reopen it if you have more information that can help us investigate the issue further. + - closeIssue From d7d0136ed6d0bc6ad35d1b72060d472753215326 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 23 Apr 2025 07:42:16 -0700 Subject: [PATCH 05/16] Update .openpublishing.publish.config.json (#11214) --- .openpublishing.publish.config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.openpublishing.publish.config.json b/.openpublishing.publish.config.json index 9d2bc465921..42fd7301f80 100644 --- a/.openpublishing.publish.config.json +++ b/.openpublishing.publish.config.json @@ -56,7 +56,7 @@ "git_repository_branch_open_to_public_contributors": "main", "skip_source_output_uploading": false, "need_preview_pull_request": true, - "need_pr_comments": true, + "need_pr_comments": false, "contribution_branch_mappings": {}, "dependent_repositories": [ { @@ -100,4 +100,4 @@ "version": "latest" } ] -} \ No newline at end of file +} From 8981257562720880800097dc1bffc67b113adb0b Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 23 Apr 2025 13:00:41 -0700 Subject: [PATCH 06/16] add language slugs (#11219) --- .../DbExpressionBuilder.xml | 20 +++++------ .../DbConnectionStringBuilder.xml | 12 +++---- xml/System.Data.Common/DbParameter.xml | 6 ++-- .../EntityConnection.xml | 36 +++++++++---------- xml/System.Data.Objects/ObjectQuery`1.xml | 8 ++--- xml/System.Data.Odbc/OdbcConnection.xml | 8 ++--- .../OdbcConnectionStringBuilder.xml | 2 +- xml/System.Data.Odbc/OdbcParameter.xml | 10 +++--- xml/System.Data.OleDb/OleDbConnection.xml | 8 ++--- .../OleDbConnectionStringBuilder.xml | 4 +-- xml/System.Data.OleDb/OleDbParameter.xml | 4 +-- .../OracleConnectionStringBuilder.xml | 2 +- xml/System.Data.OracleClient/OracleLob.xml | 8 ++--- .../OracleParameter.xml | 8 ++--- .../OracleParameterCollection.xml | 4 +-- .../SqlClientFactory.xml | 1 - xml/System.Data.SqlClient/SqlConnection.xml | 1 - .../SqlConnectionStringBuilder.xml | 8 ++--- xml/System.Data.SqlClient/SqlParameter.xml | 4 +-- .../SqlParameterCollection.xml | 2 +- xml/System.Data/DataColumn.xml | 4 +-- xml/System.Data/DataSet.xml | 16 ++++----- xml/System.Data/DataTable.xml | 10 +++--- 23 files changed, 87 insertions(+), 99 deletions(-) diff --git a/xml/System.Data.Common.CommandTrees.ExpressionBuilder/DbExpressionBuilder.xml b/xml/System.Data.Common.CommandTrees.ExpressionBuilder/DbExpressionBuilder.xml index 88aa677404a..1fd91d9d45e 100644 --- a/xml/System.Data.Common.CommandTrees.ExpressionBuilder/DbExpressionBuilder.xml +++ b/xml/System.Data.Common.CommandTrees.ExpressionBuilder/DbExpressionBuilder.xml @@ -1845,15 +1845,15 @@ The expressions produced by and , or must be an anonymous type with DbExpression-derived properties. The following are examples of supported types for `TSelector`: + To be compatible with Join, `TSelector` must be derived from , or must be an anonymous type with DbExpression-derived properties. The following are examples of supported types for `TSelector`: -``` +```csharp outer.Join(inner, o => o.Property("ID"), i => i.Property("ID"), (o, i) => o.Property("Name")) ``` (`TSelector` is ). -``` +```csharp outer.Join(inner, o => o.Property("ID"), i => i.Property("ID"), (o, i) => new { OName = o.Property("Name"), IName = i.Property("Name") }) ``` @@ -3451,15 +3451,15 @@ The result of contains a name or expression that is no , or must be an anonymous type with DbExpression-derived properties. The following are examples of supported types for `TProjection`: + To be compatible with Select, `TProjection` must be derived from , or must be an anonymous type with DbExpression-derived properties. The following are examples of supported types for `TProjection`: -``` +```csharp source.Select(x => x.Property("Name")) ``` - `TProjection` is ). + (`TProjection` is ). -``` +```csharp source.Select(x => new { Name = x.Property("Name") }) ``` @@ -3548,15 +3548,15 @@ The expression produced by does not have a collection , or must be an anonymous type with DbExpression-derived properties. The following are examples of supported types for `TSelector`: + To be compatible with SelectMany, `TSelector` must be derived from , or must be an anonymous type with DbExpression-derived properties. The following are examples of supported types for `TSelector`: -``` +```csharp source.SelectMany(x => x.Property("RelatedCollection"), (source, apply) => apply.Property("Name")) ``` (`TSelector` is ). -``` +```csharp source.SelectMany(x => x.Property("RelatedCollection"), (source, apply) => new { SourceName = source.Property("Name"), RelatedName = apply.Property("Name") }) ``` diff --git a/xml/System.Data.Common/DbConnectionStringBuilder.xml b/xml/System.Data.Common/DbConnectionStringBuilder.xml index faf3ac39b1e..68043db134c 100644 --- a/xml/System.Data.Common/DbConnectionStringBuilder.xml +++ b/xml/System.Data.Common/DbConnectionStringBuilder.xml @@ -107,7 +107,7 @@ builder["Initial Catalog"] = "AdventureWorks;NewValue=Bad"; The result is the following connection string that handles the invalid value in a safe manner: -``` +```txt data source=(local);integrated security=True; initial catalog="AdventureWorks;NewValue=Bad" ``` @@ -676,7 +676,7 @@ initial catalog="AdventureWorks;NewValue=Bad" ## Remarks This property returns a semicolon-delimited list of key/value pairs stored within the collection maintained by the . Each pair contains the key and value, separated by an equal sign. The following example illustrates a typical connection string. -``` +```txt "Persist Security Info=False;Integrated Security=SSPI;Initial Catalog=AdventureWorks;Data Source=(local)" ``` @@ -763,7 +763,7 @@ initial catalog="AdventureWorks;NewValue=Bad" This code produces the following output: -``` +```txt Contents of the DbConnectionStringBuilder: provider="Provider=Microsoft.Jet.OLEDB.4.0";data source=C:\MyExcel.xls;extended @@ -902,7 +902,7 @@ The collection contains the key "Data Source". This sample displays the following output: -``` +```txt builder1 = value1=SomeValue;value2=20;value3=30;value4=40 builder2 = value2=20;value3=30;value4=40;value1=SomeValue builder3 = value2=20;value3=30;value4=40;value1=SOMEVALUE @@ -1297,7 +1297,7 @@ builder2.EquivalentTo(builder3) = False This sample displays the following output: -``` +```txt Removed 'Provider' data source=C:\Demo.mdb;jet oledb:system database=system.mdw Unable to remove 'User ID' @@ -2817,7 +2817,7 @@ This member is an explicit interface member implementation. It can be used only The sample displays the following results: -``` +```txt Provider=sqloledb DATA SOURCE=192.168.168.1,1433 Unable to retrieve value for //InvalidKey// diff --git a/xml/System.Data.Common/DbParameter.xml b/xml/System.Data.Common/DbParameter.xml index 49c3b4dc136..c254e7f7d93 100644 --- a/xml/System.Data.Common/DbParameter.xml +++ b/xml/System.Data.Common/DbParameter.xml @@ -677,16 +677,16 @@ ## Remarks is used by the to correctly generate update commands when dealing with nullable columns. Generally, use of is limited to developers inheriting from . - uses this property to determine whether the source column is nullable, and sets this property to `true` if it is nullable, and `false` if it is not. When is generating its Update statement, it examines the for each parameter. If the property is `true`, generates a WHERE clauses like the following (in this query expression, "FieldName" represents the name of the field): + uses this property to determine whether the source column is nullable, and sets this property to `true` if it is nullable, and `false` if it is not. When generates its Update statement, it examines the for each parameter. If the property is `true`, generates a WHERE clauses like the following (in this query expression, "FieldName" represents the name of the field): -``` +```tsql ((@IsNull_FieldName = 1 AND FieldName IS NULL) OR (FieldName = @Original_FieldName)) ``` If for the field is `false`, generates the following WHERE clause: -``` +```tsql FieldName = @OriginalFieldName ``` diff --git a/xml/System.Data.EntityClient/EntityConnection.xml b/xml/System.Data.EntityClient/EntityConnection.xml index e51f16425f4..5ae90d0fc23 100644 --- a/xml/System.Data.EntityClient/EntityConnection.xml +++ b/xml/System.Data.EntityClient/EntityConnection.xml @@ -22,9 +22,9 @@ ## Remarks To avoid inadvertently putting objects such as and out of sync with their metadata, must lock its metadata. No changes to the connection string are allowed after the metadata is locked. The following are two scenarios in which metadata is locked: -- The instance is constructed through the parameterless constructor, or through the constructor, which accepts a connection string. In either case the connection string might be changed multiple times before the connection is opened. Calling or locks the metadata. +- The instance is constructed through the parameterless constructor, or through the constructor, which accepts a connection string. In either case the connection string might be changed multiple times before the connection is opened. Calling or locks the metadata. -- The instance is constructed through the constructor, which accepts a and a . In this case, the metadata is locked at construction time. No changes to the connection string are ever allowed. +- The instance is constructed through the constructor, which accepts a and a . In this case, the metadata is locked at construction time. No changes to the connection string are ever allowed. When metadata is loaded, the verifies that the conceptual model, the storage model, and the mapping file are all present. @@ -50,9 +50,9 @@ ## Remarks To avoid inadvertently putting objects such as and out of sync with their metadata, must lock its metadata. No changes to the connection string are allowed after the metadata is locked. The following are two scenarios in which metadata is locked: -- The instance is constructed through the parameterless constructor, or through the constructor, which accepts a connection string. In either case the connection string might be changed multiple times before the connection is opened. Calling or locks the metadata. +- The instance is constructed through the parameterless constructor, or through the constructor, which accepts a connection string. In either case the connection string might be changed multiple times before the connection is opened. Calling or locks the metadata. -- The instance is constructed through the constructor, which accepts a and a . In this case the metadata is locked at construction time. No changes to the connection string are ever allowed. +- The instance is constructed through the constructor, which accepts a and a . In this case the metadata is locked at construction time. No changes to the connection string are ever allowed. When metadata is loaded, the verifies that the conceptual model, the storage model, and the mapping file are all present. @@ -83,9 +83,9 @@ ## Remarks To avoid inadvertently putting objects such as and out of sync with their metadata, must lock its metadata. No changes to the connection string are allowed after the metadata is locked. The following are two scenarios in which metadata is locked: -- The instance is constructed through the parameterless constructor, or through the constructor, which accepts a connection string. In either case the connection string might be changed multiple times before the connection is opened. Calling or locks the metadata. +- The instance is constructed through the parameterless constructor, or through the constructor, which accepts a connection string. In either case the connection string might be changed multiple times before the connection is opened. Calling or locks the metadata. -- The instance is constructed through the constructor, which accepts a and a . In this case the metadata is locked at construction time. No changes to the connection string are ever allowed. +- The instance is constructed through the constructor, which accepts a and a . In this case the metadata is locked at construction time. No changes to the connection string are ever allowed. When metadata is loaded, the verifies that the conceptual model, the storage model, and the mapping file are all present. @@ -122,9 +122,9 @@ To avoid inadvertently putting objects and out of sync with their metadata, must lock its metadata. No changes to the connection string are allowed after the metadata is locked. The following are two scenarios in which metadata is locked: -- The instance is constructed through the parameterless constructor, or through this constructor (), which accepts a connection string. In either case the connection string might be changed multiple times before the connection is opened. Calling or locks the metadata. +- The instance is constructed through the parameterless constructor, or through this constructor (), which accepts a connection string. In either case the connection string might be changed multiple times before the connection is opened. Calling or locks the metadata. -- The instance is constructed through the constructor, which accepts a and a . In this case the metadata is locked at construction time. No changes to the connection string are ever allowed. +- The instance is constructed through the constructor, which accepts a and a . In this case the metadata is locked at construction time. No changes to the connection string are ever allowed. When metadata is loaded, the verifies that the conceptual model, the storage model, and the mapping file are all present. @@ -164,9 +164,9 @@ To avoid inadvertently putting objects such as and out of sync with their metadata, the must lock its metadata. No changes to the connection string are allowed after the metadata is locked. The following are two scenarios in which metadata is locked: -- The instance is constructed through the parameterless constructor, or through the constructor, which accepts a connection string. In either case the connection string might be changed multiple times before the connection is opened. Calling or locks the metadata. +- The instance is constructed through the parameterless constructor, or through the constructor, which accepts a connection string. In either case the connection string might be changed multiple times before the connection is opened. Calling or locks the metadata. -- The instance is constructed through this constructor (), which accepts a and a . In this case the metadata is locked at construction time. No changes to the connection string are ever allowed. +- The instance is constructed through this constructor (), which accepts a and a . In this case the metadata is locked at construction time. No changes to the connection string are ever allowed. When metadata is loaded, the verifies that the conceptual model, the storage model, and the mapping file are all present. @@ -408,11 +408,9 @@ If the `Name` keyword is used in the property, other keywords are not allowed. The `Name` keyword refers to a named connection string that is stored in the `connectionStrings` section in an application configuration file, as shown in the following example. The `Provider`, `Metadata`, and `Provider Connection String` values are retrieved from the configuration file at run time. - - The keyword/value pairs can also be supplied directly in the property, as shown in the following example. In this case, the `Name` keyword is not used. -``` +```txt "Provider=System.Data.SqlClient; Metadata=c:\metadata|c:\Metadata\Sql; Provider Connection String= 'Data Source=localhost; @@ -421,9 +419,9 @@ Provider Connection String= 'Data Source=localhost; To avoid inadvertently putting objects such as and out of sync with their metadata, must lock its metadata. No changes to the connection string are allowed after the metadata is locked. The following are two scenarios in which metadata is locked: -- The instance is constructed through the parameterless constructor, or through the constructor, which accepts a connection string. In either case the connection string might be changed multiple times before the connection is opened. Calling or locks the metadata. +- The instance is constructed through the parameterless constructor, or through the constructor, which accepts a connection string. In either case the connection string might be changed multiple times before the connection is opened. Calling or locks the metadata. -- The instance is constructed through the constructor, which accepts a and a . In this case the metadata is locked at construction time. No changes to the connection string are ever allowed. +- The instance is constructed through the constructor, which accepts a and a . In this case the metadata is locked at construction time. No changes to the connection string are ever allowed. When metadata is loaded, the verifies that the conceptual model, the storage model, and the mapping file are all present. @@ -716,9 +714,9 @@ Provider Connection String= 'Data Source=localhost; To avoid inadvertently putting objects such as and out of sync with their metadata, must lock its metadata. No changes to the connection string are allowed after the metadata is locked. The following are two scenarios in which metadata is locked: -- The instance is constructed through the parameterless constructor, or through the constructor, which accepts a connection string. In either case the connection string may be changed multiple times before the connection is opened. or locks the metadata. +- The instance is constructed through the parameterless constructor, or through the constructor, which accepts a connection string. In either case the connection string may be changed multiple times before the connection is opened. or locks the metadata. -- The instance is constructed through the constructor, which accepts a and a . In this case the metadata is locked at construction time. No changes to the connection string are ever allowed. +- The instance is constructed through the constructor, which accepts a and a . In this case the metadata is locked at construction time. No changes to the connection string are ever allowed. When metadata is loaded, the verifies that the conceptual model, the storage model, and the mapping file are all present. @@ -752,9 +750,9 @@ Provider Connection String= 'Data Source=localhost; ## Remarks To avoid inadvertently putting objects such as and out of sync with their metadata, must lock its metadata. No changes to the connection string are allowed after the metadata is locked. The following are two scenarios in which metadata is locked: -- The instance is constructed through the parameterless constructor, or through the constructor, which accepts a connection string. In either case the connection string might be changed multiple times before the connection is opened. Calling or locks the metadata. +- The instance is constructed through the parameterless constructor, or through the constructor, which accepts a connection string. In either case the connection string might be changed multiple times before the connection is opened. Calling or locks the metadata. -- The instance is constructed through the constructor, which that accepts a and a . In this case the metadata is locked at construction time. No changes to the connection string are ever allowed. +- The instance is constructed through the constructor, which that accepts a and a . In this case the metadata is locked at construction time. No changes to the connection string are ever allowed. When metadata is loaded, the verifies that the conceptual model, the storage model, and the mapping file are all present. diff --git a/xml/System.Data.Objects/ObjectQuery`1.xml b/xml/System.Data.Objects/ObjectQuery`1.xml index 064e169807a..2defddae484 100644 --- a/xml/System.Data.Objects/ObjectQuery`1.xml +++ b/xml/System.Data.Objects/ObjectQuery`1.xml @@ -896,13 +896,13 @@ This example creates a new that conta The supplied `query` that defines the results to add must be of the same type or of a type that can be promoted to the type of this . For example, the following is valid because `DiscontinuedProducts` can be promoted to `Products`: -``` +```csharp ObjectQuery.Union(ObjectQuery) ``` The following will throw an exception because `Products` cannot be promoted to `DiscontinuedProducts`. -``` +```csharp ObjectQuery .Union(ObjectQuery) ``` @@ -956,13 +956,13 @@ ObjectQuery .Union(ObjectQuery) The supplied `query` that defines results to add must be of the same type or of a type that can be promoted to the type of this . For example, the following is valid because `DiscontinuedProducts` can be promoted to `Products`: -``` +```csharp ObjectQuery.Union(ObjectQuery) ``` The following will throw an exception because `Products` cannot be promoted to `DiscontinuedProducts`. -``` +```csharp ObjectQuery .Union(ObjectQuery) ``` diff --git a/xml/System.Data.Odbc/OdbcConnection.xml b/xml/System.Data.Odbc/OdbcConnection.xml index c5ebdba47b4..0c992ba4372 100644 --- a/xml/System.Data.Odbc/OdbcConnection.xml +++ b/xml/System.Data.Odbc/OdbcConnection.xml @@ -519,7 +519,7 @@ You can use the property to connect to a variety of data sources. This includes an ODBC data source name (DSN). The following example illustrates several possible connection strings. -``` +```txt "Driver={SQL Server};Server=(local);Trusted_Connection=Yes;Database=AdventureWorks;" "Driver={Microsoft ODBC for Oracle};Server=ORACLE8i7;Persist Security Info=False;Trusted_Connection=Yes" @@ -538,13 +538,11 @@ Many of the settings specified in the string have corresponding read-only properties (for example, `Server=(local)`, which corresponds to the property). These properties are updated after the connection is opened, except when an error is detected. In this case, none of the properties are updated. properties (such as ) return only default settings or those settings specified in the . - In the Microsoft .NET Framework version 1.0, validation of the connection string does not occur until an application calls the method. It is the responsibility of the underlying ODBC driver to validate the connection string. If the connection string contains invalid or unsupported properties, the driver may raise an at run time. - - However, in the .NET Framework version 1.1 and later versions, some basic validation of the connection string occurs as soon as you set the property. At that time, the data provider verifies that the connection string meets the "keyword=value;..." format, but it does not verify whether keywords or values are valid. The remaining verification is performed by the underlying ODBC driver when the application calls the method. +Some basic validation of the connection string occurs as soon as you set the property. At that time, the data provider verifies that the connection string meets the "keyword=value;..." format, but it does not verify whether keywords or values are valid. The remaining verification is performed by the underlying ODBC driver when the application calls the method. An ODBC connection string has the following syntax: -``` +```txt connection-string ::= empty-string[;] | attribute[;] | attribute; connection-string empty-string ::= attribute ::= attribute-keyword=attribute-value | DRIVER=[{]attribute-value[}] diff --git a/xml/System.Data.Odbc/OdbcConnectionStringBuilder.xml b/xml/System.Data.Odbc/OdbcConnectionStringBuilder.xml index 8ecd794df3e..4b9fd52842f 100644 --- a/xml/System.Data.Odbc/OdbcConnectionStringBuilder.xml +++ b/xml/System.Data.Odbc/OdbcConnectionStringBuilder.xml @@ -79,7 +79,7 @@ Console.WriteLine(builder.ConnectionString); The result is the following connection string that handles the invalid value in a safe manner: -``` +```txt Driver={SQL Server};Server="MyServer;NewValue=Bad" ``` diff --git a/xml/System.Data.Odbc/OdbcParameter.xml b/xml/System.Data.Odbc/OdbcParameter.xml index e4ac698bab3..16568d14b3d 100644 --- a/xml/System.Data.Odbc/OdbcParameter.xml +++ b/xml/System.Data.Odbc/OdbcParameter.xml @@ -222,7 +222,7 @@ OleDbDataReader reader = command.ExecuteReader(); ## Remarks Use caution when you are using this overload of the constructor to specify integer parameter values. Because this overload takes a `value` of type , you must convert the integral value to an type when the value is zero, as the following C# example demonstrates. -``` +```csharp Parameter = new OdbcParameter("@pname", Convert.ToInt32(0)); ``` @@ -789,12 +789,10 @@ public void CreateOdbcParameter() ## Remarks Instead of named parameters, the ODBC .NET Provider uses positional parameters that are marked with a question mark (?) in the syntax of the command text. Parameter objects in the and the actual parameters accepted by the stored procedure or parameterized SQL statement correspond to each other based on the order in which the objects are inserted into the collection instead of by parameter name. Parameter names can be supplied, but will be ignored during parameter object binding. - - ## Examples The following example assumes that the data source has a table name **MyTable** and a stored procedure named MyProc that is defined as: -``` +```tsql CREATE TABLE MyTable (col1 int, col2 smallmoney, col3 decimal) CREATE PROC MyProc (@p1 int, @p2 smallmoney, @p3 decimal) AS INSERT INTO MyTable VALUES (@p1, @p2, @p3) ``` @@ -1241,14 +1239,14 @@ public void CreateOdbcParameter() uses this property to determine whether the source column is nullable, and sets this property to `true` if it is nullable, and `false` if it is not. When is generating its Update statement, it examines the for each parameter. If the property is `true`, generates a WHERE clauses like the following example. In this query expression, "FieldName" represents the name of the field: -``` +```tsql ((@IsNull_FieldName = 1 AND FieldName IS NULL) OR (FieldName = @Original_FieldName)) ``` If for the field is false, generates the following WHERE clause: -``` +```tsql FieldName = @OriginalFieldName ``` diff --git a/xml/System.Data.OleDb/OleDbConnection.xml b/xml/System.Data.OleDb/OleDbConnection.xml index 9d695fd45d5..7e9b19988a6 100644 --- a/xml/System.Data.OleDb/OleDbConnection.xml +++ b/xml/System.Data.OleDb/OleDbConnection.xml @@ -528,7 +528,7 @@ You can use the property to connect to a variety of data sources. The following example illustrates several possible connection strings. -``` +```txt "Provider=MSDAORA; Data Source=ORACLE8i7;Persist Security Info=False;Integrated Security=Yes" "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\bin\LocalAccess40.mdb" @@ -553,14 +553,12 @@ To include preceding or trailing spaces in the string value, the value must be enclosed in either single quotation marks or double quotation marks. Any leading or trailing spaces around integer, Boolean, or enumerated values are ignored, even if enclosed in quotation marks. However, spaces within a string literal keyword or value are preserved. Single or double quotation marks may be used within a connection string without using delimiters (for example, `Data Source= my'Server` or `Data Source= my"Server`) unless a quotation-mark character is the first or last character in the value. - To include an equal sign (=) in a keyword or value, it must be preceded by another equal sign. For example, in the hypothetical connection string + To include an equal sign (=) in a keyword or value, it must be preceded by another equal sign. For example, in the following hypothetical connection string, the keyword is "key=word" and the value is "value". -``` +```txt "key==word=value" ``` - the keyword is "key=word" and the value is "value". - If a specific keyword in a keyword=value pair occurs multiple times in a connection string, the last occurrence listed is used in the value set. Keywords are not case sensitive. diff --git a/xml/System.Data.OleDb/OleDbConnectionStringBuilder.xml b/xml/System.Data.OleDb/OleDbConnectionStringBuilder.xml index c7f3dc69343..99372c81f96 100644 --- a/xml/System.Data.OleDb/OleDbConnectionStringBuilder.xml +++ b/xml/System.Data.OleDb/OleDbConnectionStringBuilder.xml @@ -85,12 +85,10 @@ builder["User Id"] = "Admin;NewValue=Bad"; The result is the following connection string that handles the invalid value in a safe manner: -``` +```txt Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Sample.mdb;User ID="Admin;NewValue=Bad" ``` - - ## Examples The following console application builds connection strings for several OLE DB databases. First, the example creates a connection string for a Microsoft Access database, and then creates a connection string for an IBM DB2 database. The example also parses an existing connection string, and demonstrates various ways of manipulating the connection string's contents. diff --git a/xml/System.Data.OleDb/OleDbParameter.xml b/xml/System.Data.OleDb/OleDbParameter.xml index 7a59e9cbf01..f5264c57ff6 100644 --- a/xml/System.Data.OleDb/OleDbParameter.xml +++ b/xml/System.Data.OleDb/OleDbParameter.xml @@ -1282,14 +1282,14 @@ public void CreateOleDbParameter() uses this property to determine whether the source column is nullable, and sets this property to `true` if it is nullable, and `false` if it is not. When is generating its Update statement, it examines the for each parameter. If the property is `true`, generates a WHERE clauses like the following (in this query expression, "FieldName" represents the name of the field): -``` +```tsql ((@IsNull_FieldName = 1 AND FieldName IS NULL) OR (FieldName = @Original_FieldName)) ``` If for the field is false, generates the following WHERE clause: -``` +```tsql FieldName = @OriginalFieldName ``` diff --git a/xml/System.Data.OracleClient/OracleConnectionStringBuilder.xml b/xml/System.Data.OracleClient/OracleConnectionStringBuilder.xml index 844b98997b3..5bfd95a282e 100644 --- a/xml/System.Data.OracleClient/OracleConnectionStringBuilder.xml +++ b/xml/System.Data.OracleClient/OracleConnectionStringBuilder.xml @@ -64,7 +64,7 @@ System.Diagnostics.Debug.WriteLine(builder.ConnectionString); The result is the following connection string that handles the invalid value in a safe manner by enclosing the User ID value in quotes: -``` +```txt Data Source=OracleDemo;Integrated Security=True;User ID="Mary;NewValue=Bad" ``` diff --git a/xml/System.Data.OracleClient/OracleLob.xml b/xml/System.Data.OracleClient/OracleLob.xml index 3a1987684fc..06081771468 100644 --- a/xml/System.Data.OracleClient/OracleLob.xml +++ b/xml/System.Data.OracleClient/OracleLob.xml @@ -895,7 +895,7 @@ connection.Close(); ## Remarks The following example demonstrates how to create a temporary `LOB`. -``` +```csharp OracleConnection connection = new OracleConnection("server=MyServer; integrated security=yes;"); connection.Open(); OracleTransaction transaction = connection.BeginTransaction(); @@ -1018,14 +1018,14 @@ connection.Close ## Remarks You can construct an that is NULL using this format: -``` +```csharp OracleLob myLob = OracleLOB.Null; ``` This technique is used primarily to test whether a `LOB` returned from the server is NULL, as this example illustrates: -``` -If(myLob == OracleLob.Null) +```csharp +if(myLob == OracleLob.Null) ``` A NULL `LOB` behaves similarly to a zero byte `LOB` in that succeeds and always returns zero bytes. diff --git a/xml/System.Data.OracleClient/OracleParameter.xml b/xml/System.Data.OracleClient/OracleParameter.xml index 7484e55b4bd..e41ab7b7484 100644 --- a/xml/System.Data.OracleClient/OracleParameter.xml +++ b/xml/System.Data.OracleClient/OracleParameter.xml @@ -169,9 +169,9 @@ OleDbDataReader reader = command.ExecuteReader(); ## Remarks When you specify an in the `value` parameter, the is inferred from the Microsoft .NET Framework type of the . - Use caution when you are using this overload of the constructor. Because this overload takes a `value` of type , you must convert the integral value to an type when the value is zero, as the following Microsoft Visual C# example demonstrates. + Use caution when you are using this overload of the constructor. Because this overload takes a `value` of type , you must convert the integral value to an type when the value is zero, as the following C# example demonstrates. -``` +```csharp Parameter = new OracleParameter("pname", Convert.ToInt32(0)); ``` @@ -1087,14 +1087,14 @@ public void CreateOracleDbParameter() uses this property to determine whether the source column is nullable, and sets this property to `true` if it is nullable, and `false` if it is not. When is generating its Update statement, it examines the for each parameter. If the property is `true`, generates a WHERE clauses like the following (in this query expression, "FieldName" represents the name of the field): -``` +```tsql ((@IsNull_FieldName = 1 AND FieldName IS NULL) OR (FieldName = @Original_FieldName)) ``` If for the field is false, generates the following WHERE clause: -``` +```tsql FieldName = @OriginalFieldName ``` diff --git a/xml/System.Data.OracleClient/OracleParameterCollection.xml b/xml/System.Data.OracleClient/OracleParameterCollection.xml index cc6e5ff5ce9..ad1f47ce8d5 100644 --- a/xml/System.Data.OracleClient/OracleParameterCollection.xml +++ b/xml/System.Data.OracleClient/OracleParameterCollection.xml @@ -62,7 +62,7 @@ The .NET Framework Data Provider for Oracle does not support the question mark (?) placeholder for passing parameters to an SQL statement called by an of `CommandType.Text`. In this case, named parameters must be used. For example: -``` +```tsql SELECT * FROM Customers WHERE CustomerID = :pCustomerID ``` @@ -272,7 +272,7 @@ SELECT * FROM Customers WHERE CustomerID = :pCustomerID ## Remarks Use caution when using this overload of the method to specify integer parameter values. Because this overload takes a `value` of type , you must convert the integral value to an type when the value is zero, as the following C# example demonstrates. -``` +```csharp parameters.Add("pname", Convert.ToInt32(0)); ``` diff --git a/xml/System.Data.SqlClient/SqlClientFactory.xml b/xml/System.Data.SqlClient/SqlClientFactory.xml index ef08c175cb1..d9ce2a91e11 100644 --- a/xml/System.Data.SqlClient/SqlClientFactory.xml +++ b/xml/System.Data.SqlClient/SqlClientFactory.xml @@ -233,7 +233,6 @@ Dim cmd As DbConnection = newFactory.CreateConnection() ```csharp SqlClientFactory newFactory = SqlClientFactory.Instance; DbConnection cmd = newFactory.CreateConnection(); - ``` ]]> diff --git a/xml/System.Data.SqlClient/SqlConnection.xml b/xml/System.Data.SqlClient/SqlConnection.xml index f31b83c181e..d5ebe239892 100644 --- a/xml/System.Data.SqlClient/SqlConnection.xml +++ b/xml/System.Data.SqlClient/SqlConnection.xml @@ -87,7 +87,6 @@ Using connection As New SqlConnection(connectionString) connection.Open() ' Do work here; connection closed on following line. End Using - ``` ```csharp diff --git a/xml/System.Data.SqlClient/SqlConnectionStringBuilder.xml b/xml/System.Data.SqlClient/SqlConnectionStringBuilder.xml index f31e0ddcb68..1c543523837 100644 --- a/xml/System.Data.SqlClient/SqlConnectionStringBuilder.xml +++ b/xml/System.Data.SqlClient/SqlConnectionStringBuilder.xml @@ -78,7 +78,7 @@ Console.WriteLine(builder.ConnectionString); The result is the following connection string that handles the invalid value in a safe manner: -``` +```txt Source=(local);Initial Catalog="AdventureWorks;NewValue=Bad"; Integrated Security=True ``` @@ -275,7 +275,7 @@ The class provides a fix The sample displays the following text in the console window: -``` +```txt Original: Data Source=(local);Initial Catalog=AdventureWorks;Integrated Security=True ApplicationName=".Net SqlClient Data Provider" Modified: Data Source=(local);Initial Catalog=AdventureWorks;Integrated Security=True;Application Name="My Application" @@ -776,7 +776,7 @@ Modified: Data Source=(local);Initial Catalog=AdventureWorks;Integrated Security The example displays the following output in the console window: -``` +```txt Connection string = Data Source=(local);Initial Catalog=AdventureWorks;Integrated Security=True True True @@ -2385,7 +2385,7 @@ This property corresponds to the "Integrated Security" and "trusted_connection" The sample displays the following results: -``` +```txt Data Source=(local) Trusted_Connection=True Unable to retrieve value for 'InvalidKey' diff --git a/xml/System.Data.SqlClient/SqlParameter.xml b/xml/System.Data.SqlClient/SqlParameter.xml index 504a954e171..b9704454bbe 100644 --- a/xml/System.Data.SqlClient/SqlParameter.xml +++ b/xml/System.Data.SqlClient/SqlParameter.xml @@ -1451,14 +1451,14 @@ static void CreateSqlParameterLocaleId(){ uses this property to determine whether the source column is nullable, and sets this property to `true` if it is nullable, and `false` if it is not. When is generating its Update statement, it examines the for each parameter. If the property is `true`, generates a WHERE clauses like the following (in this query expression, "FieldName" represents the name of the field): -``` +```tsql ((@IsNull_FieldName = 1 AND FieldName IS NULL) OR (FieldName = @Original_FieldName)) ``` If for the field is false, generates the following WHERE clause: -``` +```tsql FieldName = @OriginalFieldName ``` diff --git a/xml/System.Data.SqlClient/SqlParameterCollection.xml b/xml/System.Data.SqlClient/SqlParameterCollection.xml index fd3661488af..f45bb27a302 100644 --- a/xml/System.Data.SqlClient/SqlParameterCollection.xml +++ b/xml/System.Data.SqlClient/SqlParameterCollection.xml @@ -328,7 +328,7 @@ This member is an explicit interface member implementation. It can be used only Use caution when you are using this overload of the method to specify integer parameter values. Because this overload takes a of type , you must convert the integral value to an type when the value is zero, as the following C# example demonstrates. -``` +```csharp parameters.Add("@pname", Convert.ToInt32(0)); ``` diff --git a/xml/System.Data/DataColumn.xml b/xml/System.Data/DataColumn.xml index 128f2fd830e..293cdd7df71 100644 --- a/xml/System.Data/DataColumn.xml +++ b/xml/System.Data/DataColumn.xml @@ -982,7 +982,7 @@ For example, if a is named "customerID," and its property is set to `MappingType.Element`, the column value will produce the following XML: -``` +```xml ALFKI ...... @@ -996,7 +996,7 @@ However, if the same column is mapped to `MappingType.Attribute`, the following XML is produced: -``` +```xml diff --git a/xml/System.Data/DataSet.xml b/xml/System.Data/DataSet.xml index 328e7015d21..06fa3005d33 100644 --- a/xml/System.Data/DataSet.xml +++ b/xml/System.Data/DataSet.xml @@ -4265,7 +4265,7 @@ class Program { If the XML Schema for a includes `targetNamespace`, data may not be read, and you may encounter exceptions when calling to load the with XML that contains elements with no qualifying namespace. To read unqualified elements, set `elementFormDefault` equal to "qualified" in your XML Schema, as the following example demonstrates. -``` +```xml includes `targetNamespace`, data may not be read, and you may encounter exceptions when calling to load the with XML that contains elements with no qualifying namespace. To read unqualified elements, set `elementFormDefault` equal to "qualified" in your XML Schema as the following example demonstrates. -``` +```xml includes a `targetNamespace`, data may not be read, and you may encounter exceptions when calling to load the with XML that contains elements with no qualifying namespace. To read unqualified elements, set `elementFormDefault` equal to "qualified" in your XML Schema as the following example demonstrates. -``` +```xml includes a `targetNamespace`, data may not be read, and you may encounter exceptions when calling to load the with XML that contains elements with no qualifying namespace. To read unqualified elements, set `elementFormDefault` equal to "qualified" in your XML Schema as the following example demonstrates. -``` +```xml includes `targetNamespace`, data may not be read, and you may encounter exceptions when calling to load the with XML that contains elements with no qualifying namespace. To read unqualified elements, set `elementFormDefault` equal to "qualified" in your XML Schema as the following example demonstrates. -``` +```xml includes `targetNamespace`, data may not be read, and you may encounter exceptions when calling to load the with XML that contains elements with no qualifying namespace. To read unqualified elements, set `elementFormDefault` equal to "qualified" in your XML Schema as the following example demonstrates. -``` +```xml includes a `targetNamespace`, data may not be read, and you may encounter exceptions when calling to load the with XML that contains elements with no qualifying namespace. To read unqualified elements, set `elementFormDefault` equal to "qualified" in your XML Schema as the following example demonstrates. -``` +```xml includes a `targetNamespace`, data may not be read, and you may encounter exceptions when calling to load the with XML that contains elements with no qualifying namespace. To read unqualified elements, set `elementFormDefault` equal to "qualified" in your XML Schema as the following example demonstrates. -``` +```xml The example displays the following output in the console window: -``` +```xml ============================== Customer table, without hierarchy ============================== @@ -8562,7 +8562,7 @@ sdata:PrimaryKey="true"> The example displays the following output in the console window: -``` +```xml ============================== Customer table, without hierarchy ============================== @@ -9046,7 +9046,7 @@ xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> The example displays the following output in the console window: -``` +```xml ============================== Customer table, without hierarchy ============================== From 626a49ce26d4665bab65a47f4ad5ef7961c9dffb Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 23 Apr 2025 13:46:30 -0700 Subject: [PATCH 07/16] Add language slugs (System.Net) (#11225) --- .../AuthenticationHeaderValue.xml | 36 ++++++++++--------- xml/System.Net.Http/HttpClientHandler.xml | 2 +- xml/System.Net.Http/SocketsHttpHandler.xml | 1 + 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/xml/System.Net.Http.Headers/AuthenticationHeaderValue.xml b/xml/System.Net.Http.Headers/AuthenticationHeaderValue.xml index d56ae13e164..f640686efe1 100644 --- a/xml/System.Net.Http.Headers/AuthenticationHeaderValue.xml +++ b/xml/System.Net.Http.Headers/AuthenticationHeaderValue.xml @@ -55,11 +55,11 @@ Represents authentication information in Authorization, ProxyAuthorization, WWW-Authenticate, and Proxy-Authenticate header values. - class provides support for the Authorization, ProxyAuthorization, WWW-Authenticate, and Proxy-Authenticate HTTP header values as defined in [RFC 2616](https://go.microsoft.com/fwlink/?LinkID=241642) by the IETF. - + class provides support for the Authorization, ProxyAuthorization, WWW-Authenticate, and Proxy-Authenticate HTTP header values as defined in [RFC 2616](https://go.microsoft.com/fwlink/?LinkID=241642) by the IETF. + ]]> @@ -111,8 +111,9 @@ The scheme to use for authorization. Initializes a new instance of the class. - The credentials containing the authentication information of the user agent for the resource being requested. Initializes a new instance of the class. - @@ -283,13 +287,13 @@ Authorization: Bearer ACCESS_TOKEN Serves as a hash function for an object. A hash code for the current object. - method is suitable for use in hashing algorithms and data structures such as a hash table. - + method is suitable for use in hashing algorithms and data structures such as a hash table. + ]]> diff --git a/xml/System.Net.Http/HttpClientHandler.xml b/xml/System.Net.Http/HttpClientHandler.xml index 26e77c2c72c..5bb51b4934b 100644 --- a/xml/System.Net.Http/HttpClientHandler.xml +++ b/xml/System.Net.Http/HttpClientHandler.xml @@ -506,7 +506,7 @@ If the property h The property addresses this limitation. The delegate returned by the property can be assigned to the property, as the following example does: -```cs +```csharp handler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator; ``` diff --git a/xml/System.Net.Http/SocketsHttpHandler.xml b/xml/System.Net.Http/SocketsHttpHandler.xml index e9df0850c22..4a5296d7cfc 100644 --- a/xml/System.Net.Http/SocketsHttpHandler.xml +++ b/xml/System.Net.Http/SocketsHttpHandler.xml @@ -54,6 +54,7 @@ If this change is undesirable and you are on .NET Core 2.1-3.1, you can configur ```vb AppContext.SetSwitch("System.Net.Http.UseSocketsHttpHandler", False) ``` + - By defining the `System.Net.Http.UseSocketsHttpHandler` switch in the *.netcore.runtimeconfig.json* configuration file: ```json From 80358d22ee7ca7d3949b98f9df3592fe52dad9a8 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 23 Apr 2025 14:13:05 -0700 Subject: [PATCH 08/16] add language slugs (#11220) --- .../DirListBox.xml | 2 +- .../FileListBox.xml | 2 +- xml/Microsoft.Windows.Themes/BulletChrome.xml | 5 ++-- xml/Microsoft.Windows.Themes/ButtonChrome.xml | 4 ++-- .../ClassicBorderDecorator.xml | 6 ++--- .../DataGridHeaderBorder.xml | 6 ++--- .../ListBoxChrome.xml | 6 ++--- xml/Microsoft.Windows.Themes/ScrollChrome.xml | 4 ++-- .../ActivityDesigner.xml | 10 ++------ .../DesignerTransaction.xml | 12 ++++------ .../ICustomTypeDescriptor.xml | 2 +- .../FederationConfiguration.xml | 4 ++-- .../WSFederationAuthenticationModule.xml | 2 +- .../ManagementCreateAttribute.xml | 6 ++--- .../ManagementEntityAttribute.xml | 24 +++++++------------ .../ManagementNameAttribute.xml | 2 +- .../ManagementQualifierAttribute.xml | 2 +- .../ManagementQualifierFlavors.xml | 2 +- .../ManagementReferenceAttribute.xml | 2 +- .../WmiConfigurationAttribute.xml | 12 +++++----- .../ReliableSessionBindingElement.xml | 2 +- ...ureConversationSecurityTokenParameters.xml | 2 +- .../ServiceBehaviorAttribute.xml | 3 +-- 23 files changed, 53 insertions(+), 69 deletions(-) diff --git a/xml/Microsoft.VisualBasic.Compatibility.VB6/DirListBox.xml b/xml/Microsoft.VisualBasic.Compatibility.VB6/DirListBox.xml index 1284816a99f..f44f6c5ed4b 100644 --- a/xml/Microsoft.VisualBasic.Compatibility.VB6/DirListBox.xml +++ b/xml/Microsoft.VisualBasic.Compatibility.VB6/DirListBox.xml @@ -933,7 +933,7 @@ The `Path` property can also be set to a qualified network path without a drive connection using the following syntax: -``` +```txt \\servername\sharename\path ``` diff --git a/xml/Microsoft.VisualBasic.Compatibility.VB6/FileListBox.xml b/xml/Microsoft.VisualBasic.Compatibility.VB6/FileListBox.xml index 81ae42df177..2a9917ece6d 100644 --- a/xml/Microsoft.VisualBasic.Compatibility.VB6/FileListBox.xml +++ b/xml/Microsoft.VisualBasic.Compatibility.VB6/FileListBox.xml @@ -696,7 +696,7 @@ The `Path` property can also be set to a qualified network path without a drive connection using the following syntax: -``` +```txt \\servername\sharename\path ``` diff --git a/xml/Microsoft.Windows.Themes/BulletChrome.xml b/xml/Microsoft.Windows.Themes/BulletChrome.xml index 82cad17ecd6..257d52f8b78 100644 --- a/xml/Microsoft.Windows.Themes/BulletChrome.xml +++ b/xml/Microsoft.Windows.Themes/BulletChrome.xml @@ -66,13 +66,14 @@ ## XAML Object Element Usage -``` +```xaml ``` ## XAML Values - `theme:` + + `theme:`\ An xmlns prefix for the CLR namespace. Typically, xmlns prefixes and mappings are defined in a XAML root element (not shown). ]]> diff --git a/xml/Microsoft.Windows.Themes/ButtonChrome.xml b/xml/Microsoft.Windows.Themes/ButtonChrome.xml index 8b108a618d8..40a38bc9326 100644 --- a/xml/Microsoft.Windows.Themes/ButtonChrome.xml +++ b/xml/Microsoft.Windows.Themes/ButtonChrome.xml @@ -66,13 +66,13 @@ ## XAML Object Element Usage -``` +```xaml ``` ## XAML Values - `theme:` + `theme:`\ An xmlns prefix for the CLR namespace. Typically, xmlns prefixes and mappings are defined in a XAML root element (not shown). ]]> diff --git a/xml/Microsoft.Windows.Themes/ClassicBorderDecorator.xml b/xml/Microsoft.Windows.Themes/ClassicBorderDecorator.xml index ea1c45455cf..19199737fbb 100644 --- a/xml/Microsoft.Windows.Themes/ClassicBorderDecorator.xml +++ b/xml/Microsoft.Windows.Themes/ClassicBorderDecorator.xml @@ -32,7 +32,7 @@ ## XAML Object Element Usage -``` +```xaml   singleChild @@ -40,10 +40,10 @@ ## XAML Values - `theme:` + `theme:`\ An xmlns prefix for the CLR namespace. Typically, xmlns prefixes and mappings are defined in a XAML root element (not shown). - *singleChild* + *singleChild*\ A single object element child, representing the object that the border is drawn around. This object must be a . Typical child elements are either a fixed (for example a ) or are a presenter or another decorator in compositing. ]]> diff --git a/xml/Microsoft.Windows.Themes/DataGridHeaderBorder.xml b/xml/Microsoft.Windows.Themes/DataGridHeaderBorder.xml index 2e5ec7c3303..73178b9070b 100644 --- a/xml/Microsoft.Windows.Themes/DataGridHeaderBorder.xml +++ b/xml/Microsoft.Windows.Themes/DataGridHeaderBorder.xml @@ -81,7 +81,7 @@ ## XAML Object Element Usage -``` +```xaml   singleChild @@ -89,10 +89,10 @@ ## XAML Values - `theme:` + `theme:`\ An xmlns prefix for the CLR namespace. Typically, xmlns prefixes and mappings are defined in a XAML root element (not shown). - *singleChild* + *singleChild*\ A single object element child, representing the object that the border is drawn around. This object must be a . ]]> diff --git a/xml/Microsoft.Windows.Themes/ListBoxChrome.xml b/xml/Microsoft.Windows.Themes/ListBoxChrome.xml index b7a05be2ed3..987c207dccd 100644 --- a/xml/Microsoft.Windows.Themes/ListBoxChrome.xml +++ b/xml/Microsoft.Windows.Themes/ListBoxChrome.xml @@ -41,7 +41,7 @@ ## XAML Object Element Usage -``` +```xaml   singleChild @@ -49,10 +49,10 @@ ## XAML Values - `theme:` + `theme:`\ An xmlns prefix for the CLR namespace. Typically, xmlns prefixes and mappings are defined in a XAML root element (not shown). - *singleChild* + *singleChild*\ A single object element child, representing the object that the decorator is drawn around. This object must be a . ]]> diff --git a/xml/Microsoft.Windows.Themes/ScrollChrome.xml b/xml/Microsoft.Windows.Themes/ScrollChrome.xml index b0c3cf30449..de8e08ab6ff 100644 --- a/xml/Microsoft.Windows.Themes/ScrollChrome.xml +++ b/xml/Microsoft.Windows.Themes/ScrollChrome.xml @@ -73,13 +73,13 @@ ## XAML Object Element Usage -``` +```xaml ``` ## XAML Values - `theme:` + `theme:`\ An xmlns prefix for the CLR namespace. Typically, xmlns prefixes and mappings are defined in a XAML root element (not shown). ]]> diff --git a/xml/System.Activities.Presentation/ActivityDesigner.xml b/xml/System.Activities.Presentation/ActivityDesigner.xml index 39e46c8d5ac..87df0ff6556 100644 --- a/xml/System.Activities.Presentation/ActivityDesigner.xml +++ b/xml/System.Activities.Presentation/ActivityDesigner.xml @@ -23,21 +23,16 @@ The inherits from and primarily adds the default styling, as well as the ability to customize the icon via the property. It should be used whenever you are creating a designer for a type that derives from . When associated with an type, the property will point to the ModelItem hierarchy describing the instance of that type being edited. - - ## Examples In the sample code below, a `First2of3` activity is defined first, then the code for the First2of3 designer is shown, and finally it is shown how to use the Designer attribute to associate the activity with the designer is provided. -``` - -//The First2of3 activity +```csharp using System.Activities; using System.Collections.Generic; using System.Linq; namespace Microsoft.Activities.Documentation.ActivityTypes { - public sealed class First2of3 : NativeActivity { public Activity Activity1 { get; set; } @@ -112,10 +107,9 @@ namespace Microsoft.Activities.Documentation.ActivityTypes -//Code for associating the activity with the designer using the Designer attribute. +// Code for associating the activity with the designer using the Designer attribute. [Designer(typeof(First2of3Designer))] public sealed class First2of3 : NativeActivity - ``` ]]> diff --git a/xml/System.ComponentModel.Design/DesignerTransaction.xml b/xml/System.ComponentModel.Design/DesignerTransaction.xml index 3988266df49..a78f2628cf3 100644 --- a/xml/System.ComponentModel.Design/DesignerTransaction.xml +++ b/xml/System.ComponentModel.Design/DesignerTransaction.xml @@ -68,19 +68,19 @@ To perform an action within a transaction, you must first create a transaction. Then you must call the method before each change or set of changes occurs, and the method after each change or set of changes occur. Finally, complete and close the transaction by calling the method. > [!NOTE] -> When making changes to property values, use the method of a , which calls the component change methods of the and creates a representing the change automatically. +> When making changes to property values, use the method of a , which calls the component change methods of the and creates a representing the change automatically. To perform a transaction, complete the following steps: -1. Call to obtain a that can be used to control the transaction. +1. Call to obtain a that can be used to control the transaction. -2. Within a `try` block, for each action that you want to track with a , call the method, make the change or changes, then call the method to signal that the change or changes have been made. +2. Within a `try` block, for each action that you want to track with a , call the method, make the change or changes, then call the method to signal that the change or changes have been made. -3. To complete the transaction, call from within a `finally` block. +3. To complete the transaction, call from within a `finally` block. In C#, you can use the `using` statement rather than a `try/finally` block, such as in the following example. -``` +```csharp using (host.CreateTransaction() { // Insert your code here. } @@ -88,8 +88,6 @@ using (host.CreateTransaction() { To cancel and attempt to roll back a transaction before it has been committed, call the method. When the method is invoked, the actions tracked by the are reversed to attempt to roll back the changes. To undo actions that occurred as part of earlier transactions, you must use the undo command provided by the development environment. - - ## Examples The following code example program demonstrates how to create a from a designer. To run this sample, compile the source code into a class library. You must add a reference to the System.Design assembly. In a new project, add a reference to the compiled DLL and add the component in the library to the **Toolbox**. diff --git a/xml/System.ComponentModel/ICustomTypeDescriptor.xml b/xml/System.ComponentModel/ICustomTypeDescriptor.xml index 12ca37610c0..80c7344332b 100644 --- a/xml/System.ComponentModel/ICustomTypeDescriptor.xml +++ b/xml/System.ComponentModel/ICustomTypeDescriptor.xml @@ -925,7 +925,7 @@ This method should return an object that you can use as follows: -``` +```csharp pd.GetValue(GetPropertyOwner(myPd)); ``` diff --git a/xml/System.IdentityModel.Services.Configuration/FederationConfiguration.xml b/xml/System.IdentityModel.Services.Configuration/FederationConfiguration.xml index c6eb496a810..5a7ca846374 100644 --- a/xml/System.IdentityModel.Services.Configuration/FederationConfiguration.xml +++ b/xml/System.IdentityModel.Services.Configuration/FederationConfiguration.xml @@ -101,7 +101,7 @@ The `system.identityModel` section must be specified in a `
` element under the `` element in the configuration file or an exception is thrown. -``` +```xml
@@ -147,7 +147,7 @@ Both the `system.identityModel` section and the `system.identityModel.services` must be specified in a `
` elements under the `` element in the configuration file or an exception is thrown. -``` +```xml
diff --git a/xml/System.IdentityModel.Services/WSFederationAuthenticationModule.xml b/xml/System.IdentityModel.Services/WSFederationAuthenticationModule.xml index 7ebbc3f696a..4f1d0959429 100644 --- a/xml/System.IdentityModel.Services/WSFederationAuthenticationModule.xml +++ b/xml/System.IdentityModel.Services/WSFederationAuthenticationModule.xml @@ -86,7 +86,7 @@ To be used, the module must be added to the pipeline as in the following XML: -``` +```xml diff --git a/xml/System.Management.Instrumentation/ManagementCreateAttribute.xml b/xml/System.Management.Instrumentation/ManagementCreateAttribute.xml index 12a91e30815..f57284593c4 100644 --- a/xml/System.Management.Instrumentation/ManagementCreateAttribute.xml +++ b/xml/System.Management.Instrumentation/ManagementCreateAttribute.xml @@ -32,14 +32,12 @@ The method parameters should have the same name and type as the parameters of the class binding constructor. - Use of this attribute does not have any affect on registration of the WMI class in the repository. It is only used at runtime. - - + Use of this attribute does not have any affect on registration of the WMI class in the repository. It is only used at run time. ## Examples The following example demonstrates how to use the ManagementCreate attribute. -``` +```csharp [ManagementEntity] public class ProcessInstance { diff --git a/xml/System.Management.Instrumentation/ManagementEntityAttribute.xml b/xml/System.Management.Instrumentation/ManagementEntityAttribute.xml index 5faddeed2c9..f8f6f29aa8f 100644 --- a/xml/System.Management.Instrumentation/ManagementEntityAttribute.xml +++ b/xml/System.Management.Instrumentation/ManagementEntityAttribute.xml @@ -23,26 +23,20 @@ The ManagementEntity attribute indicates that a class provides management information exposed through a WMI provider. - Note: the WMI .NET libraries are now considered in final state, and no further development, enhancements, or updates will be available for non-security related issues affecting these libraries. The MI APIs should be used for all new development. + Note: The WMI .NET libraries are now considered in final state, and no further development, enhancements, or updates will be available for non-security related issues affecting these libraries. Use the MI APIs for all new development. @@ -159,7 +153,7 @@ ## Examples In the following example, the Name parameter is used to set the name of the WMI class represented by the MortgageCalcWMIProvider class. It sets the name to MortgageCalculator. If the Name parameter is not used, the corresponding C# class name, MortgageCalcWMIProvider in this case, is used as the WMI class name. -``` +```csharp [ManagementEntity(Name = "MortgageCalculator")] public class MortgageCalcWMIProvider { @@ -212,12 +206,12 @@ public class MortgageCalcWMIProvider ## Examples The following code snippet demonstrates how to use the Singleton parameter to indicate that a C# class corresponds to a singleton WMI class. -``` +```csharp [ManagementEntity(Singleton=true)] -public class SingletonSample +public class SingletonSample { } ``` - For a complete, working example of a provider that implements a singleton class, see [How to: Create a Basic Decoupled Provider](https://msdn.microsoft.com/library/1dabd442-c1ff-40a1-bb0e-d7b3566c2300). + For a complete, working example of a provider that implements a singleton class, see [How to: Create a Basic Decoupled Provider](/previous-versions/bb885134(v=vs.90)). ]]> diff --git a/xml/System.Management.Instrumentation/ManagementNameAttribute.xml b/xml/System.Management.Instrumentation/ManagementNameAttribute.xml index 31655078879..9c1b7f15f95 100644 --- a/xml/System.Management.Instrumentation/ManagementNameAttribute.xml +++ b/xml/System.Management.Instrumentation/ManagementNameAttribute.xml @@ -35,7 +35,7 @@ ## Examples In the following example, the integer parameter remains i internally, but will be exposed as "The Value" to WMI clients. -``` +```csharp [ManagementTask] static public int PrintValue([ManagementName("The Value")]int i) { diff --git a/xml/System.Management.Instrumentation/ManagementQualifierAttribute.xml b/xml/System.Management.Instrumentation/ManagementQualifierAttribute.xml index 1c26834c82a..b450c05b70c 100644 --- a/xml/System.Management.Instrumentation/ManagementQualifierAttribute.xml +++ b/xml/System.Management.Instrumentation/ManagementQualifierAttribute.xml @@ -37,7 +37,7 @@ ## Examples The following example demonstrates using the ManagementQualifier attribute to indicate that a class implements a WMI association class. In this case, the qualifier has a flavor that specifies that the effect of the qualifier cannot be overridden in subclasses. -``` +```csharp [ManagementQualifier("Association", Flavor = ManagementQualifierFlavors.DisableOverride)] public class AssociationSample { diff --git a/xml/System.Management.Instrumentation/ManagementQualifierFlavors.xml b/xml/System.Management.Instrumentation/ManagementQualifierFlavors.xml index 66bd3f24760..bb808c43ff2 100644 --- a/xml/System.Management.Instrumentation/ManagementQualifierFlavors.xml +++ b/xml/System.Management.Instrumentation/ManagementQualifierFlavors.xml @@ -34,7 +34,7 @@ ## Examples The following example demonstrates how to use the DisableOverride ManagementQualifierFlavors enumeration. Here it is being applied to the Association qualifier. -``` +```csharp [ManagementQualifier("Association", Flavor = ManagementQualifierFlavors.DisableOverride)] public class AssociationSampleBase diff --git a/xml/System.Management.Instrumentation/ManagementReferenceAttribute.xml b/xml/System.Management.Instrumentation/ManagementReferenceAttribute.xml index a14148829ae..1f7b02c3d17 100644 --- a/xml/System.Management.Instrumentation/ManagementReferenceAttribute.xml +++ b/xml/System.Management.Instrumentation/ManagementReferenceAttribute.xml @@ -37,7 +37,7 @@ To compile the example, you will need to include references to both System.Management.Instrumentation and System.Configuration.Install. You must run installutil.exe against the resulting executable and ensure that the program is running in order to use the implemented WMI classes. -``` +```csharp using System; using System.Collections; using System.Management.Instrumentation; diff --git a/xml/System.Management.Instrumentation/WmiConfigurationAttribute.xml b/xml/System.Management.Instrumentation/WmiConfigurationAttribute.xml index b630cf121f5..3e0f888055f 100644 --- a/xml/System.Management.Instrumentation/WmiConfigurationAttribute.xml +++ b/xml/System.Management.Instrumentation/WmiConfigurationAttribute.xml @@ -41,7 +41,7 @@ ## Examples -``` +```csharp // Specify that this assembly contains code that implements a WMI // Provider. Use the assembly:WmiConfiguration attribute to define // the WMI namespace, the hosting model, and the impersonation mode @@ -129,7 +129,7 @@ ## Examples In the following example, the is used to indicate that the assembly it is contained in implements an in-process provider that runs under the NetworkService security context and is hosted in a instance of the Wmiprvse.exe process that also hosts any other in-process providers in the same hosting group that also run within the NetworkService security context. -``` +```csharp [assembly: WmiConfiguration("root\\NVPair", HostingModel = ManagementHostingModel.NetworkService), HostingGroup = "MyProviders"] ``` @@ -179,13 +179,13 @@ ## Examples In the following example, the is used to indicate that the assembly it is contained in implements a provider that is exposed through the root\NVPair namespace. Because the hosting model is not , it is an in-process provider. The value indicates that the in-process provider runs under the NetworkService security context. -``` +```csharp [assembly: WmiConfiguration("root\\NVPair", HostingModel = ManagementHostingModel.NetworkService)] ``` In the next example, the is used to indicate that the assembly it is contained in implements a provider that is exposed through the root\NVPair namespace. The value indicates that it is a decoupled provider. -``` +```csharp [assembly: WmiConfiguration("root\\NVPair", HostingModel = ManagementHostingModel.Decoupled)] ``` @@ -231,7 +231,7 @@ ## Examples The following example demonstrates how to use the IdentifyLevel parameter to indicate that the provider can impersonate its callers. -``` +```csharp [assembly: WmiConfiguration("root/MyProv", HostingModel = ManagementHostingModel.Decoupled, IdentifyLevel = true] ``` @@ -277,7 +277,7 @@ ## Examples The following example demonstrates how to use the NamespaceSecurity parameter to set the security descriptor on the root/SDTest namespace in which the provider implemented in this assembly exposes WMI classes. -``` +```csharp [assembly: WmiConfiguration("root/SDTest", HostingModel = ManagementHostingModel.Decoupled, IdentifyLevel = false, NamespaceSecurity = "O:BAG:BAD:(A;CI;0x60003;;;WD)")] ``` diff --git a/xml/System.ServiceModel.Channels/ReliableSessionBindingElement.xml b/xml/System.ServiceModel.Channels/ReliableSessionBindingElement.xml index 4578e0558c2..b2cde27a420 100644 --- a/xml/System.ServiceModel.Channels/ReliableSessionBindingElement.xml +++ b/xml/System.ServiceModel.Channels/ReliableSessionBindingElement.xml @@ -67,7 +67,7 @@ ## Examples The can be added to any custom binding. This is done using the following configuration elements. -``` +```xml diff --git a/xml/System.ServiceModel.Security.Tokens/SecureConversationSecurityTokenParameters.xml b/xml/System.ServiceModel.Security.Tokens/SecureConversationSecurityTokenParameters.xml index 66f9af62c73..a036291e0a4 100644 --- a/xml/System.ServiceModel.Security.Tokens/SecureConversationSecurityTokenParameters.xml +++ b/xml/System.ServiceModel.Security.Tokens/SecureConversationSecurityTokenParameters.xml @@ -779,7 +779,7 @@ The following configuration exhibits this behavior. -``` +```xml diff --git a/xml/System.ServiceModel/ServiceBehaviorAttribute.xml b/xml/System.ServiceModel/ServiceBehaviorAttribute.xml index db8b4f1bee3..ebfad7be975 100644 --- a/xml/System.ServiceModel/ServiceBehaviorAttribute.xml +++ b/xml/System.ServiceModel/ServiceBehaviorAttribute.xml @@ -286,7 +286,6 @@ public void MyMethod() this.ModifyNonLocalState; return returnValue; } - ``` Using the Begin/End asynchronous call pattern for an outbound call when the is triggers an exception. Asynchronous outbound calls require an operation in which is , in which case you must handle synchronization issues. @@ -296,7 +295,7 @@ public void MyMethod() In addition, if the is set to and a reentrant call is blocked while waiting for the instance to be freed, the system detects the deadlock and throws an exception. > [!NOTE] -> A is thrown at runtime if is `true` when the property is set to . +> A is thrown at run time if is `true` when the property is set to . Note that you must explicitly set to `false` if there is an operation with set to true and you set to . Otherwise a validation exception is thrown because the default value of is `true`. From 3774ce2e8dc805127c0b2fc7e064830922772fef Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 23 Apr 2025 18:45:04 -0700 Subject: [PATCH 09/16] Code example cleanup (#11234) --- .../IniConfigurationProvider.xml | 2 +- .../PolicyHttpMessageHandler.xml | 4 ++-- .../InlineArrayAttribute.xml | 5 +++-- .../SwiftError.xml | 14 ++++++++------ .../SwiftIndirectResult.xml | 8 ++++---- .../SwiftSelf.xml | 14 ++++++++------ .../SwiftSelf`1.xml | 14 ++++++++------ 7 files changed, 34 insertions(+), 27 deletions(-) diff --git a/xml/Microsoft.Extensions.Configuration.Ini/IniConfigurationProvider.xml b/xml/Microsoft.Extensions.Configuration.Ini/IniConfigurationProvider.xml index 3c55a309abf..dd98f46445b 100644 --- a/xml/Microsoft.Extensions.Configuration.Ini/IniConfigurationProvider.xml +++ b/xml/Microsoft.Extensions.Configuration.Ini/IniConfigurationProvider.xml @@ -43,7 +43,7 @@ INI files are simple line structures ([INI Files on Wikipedia](https://en.wikipedia.org/wiki/INI_file)). The following example demonstrates a structure of the INI file: -``` +```ini [Section:Header] key1=value1 key2 = " value2 " diff --git a/xml/Microsoft.Extensions.Http/PolicyHttpMessageHandler.xml b/xml/Microsoft.Extensions.Http/PolicyHttpMessageHandler.xml index de313a16430..cfc8948e139 100644 --- a/xml/Microsoft.Extensions.Http/PolicyHttpMessageHandler.xml +++ b/xml/Microsoft.Extensions.Http/PolicyHttpMessageHandler.xml @@ -36,8 +36,8 @@ The and the convenience methods only accept the generic . Generic policy instances can be created by using the generic methods on such as . To adapt an existing non-generic , use code like the following: - -``` + +```csharp policy.AsAsyncPolicy<HttpResponseMessage>() ``` diff --git a/xml/System.Runtime.CompilerServices/InlineArrayAttribute.xml b/xml/System.Runtime.CompilerServices/InlineArrayAttribute.xml index 9fac13f34c7..57f22e95a02 100644 --- a/xml/System.Runtime.CompilerServices/InlineArrayAttribute.xml +++ b/xml/System.Runtime.CompilerServices/InlineArrayAttribute.xml @@ -35,7 +35,7 @@ This attribute can be used to annotate a `struct` type with a single field. The runtime replicates that field in the actual type layout as many times as is specified. > [!IMPORTANT] -> .NET 9 and later, the default implementations of `Equals()` and `GetHashCode()` for types marked with this attribute throw . You must override both and if they will be used. +> In .NET 9 and later versions, the default implementations of `Equals()` and `GetHashCode()` for types marked with this attribute throw . You must override both and if they will be used. ]]> @@ -46,7 +46,8 @@ This attribute can be used to annotate a `struct` type with a single field. The { private float _value; } - + + diff --git a/xml/System.Runtime.InteropServices.Swift/SwiftError.xml b/xml/System.Runtime.InteropServices.Swift/SwiftError.xml index c518036d9d3..410134cf9c2 100644 --- a/xml/System.Runtime.InteropServices.Swift/SwiftError.xml +++ b/xml/System.Runtime.InteropServices.Swift/SwiftError.xml @@ -26,12 +26,14 @@ Represents the Swift error context, indicating that the argument is the error context. - - This struct is used to retrieve the 'error' context from Swift functions in the context of interop with .NET. - - Here's an example of how a SwiftError can be declared: - [UnmanagedCallConv(CallConvs = [typeof(CallConvSwift)])] [DllImport("SwiftLibrary", EntryPoint = "export")] public static extern void swiftFunction(SwiftError* error); - + This struct is used to retrieve the 'error' context from Swift functions in the context of interop with .NET. + Here's an example of how a SwiftError can be declared: + + [UnmanagedCallConv(CallConvs = [typeof(CallConvSwift)])] + [DllImport("SwiftLibrary", EntryPoint = "export")] + public static extern void swiftFunction(SwiftError* error); + + diff --git a/xml/System.Runtime.InteropServices.Swift/SwiftIndirectResult.xml b/xml/System.Runtime.InteropServices.Swift/SwiftIndirectResult.xml index 13758df3b6e..e81bd41d668 100644 --- a/xml/System.Runtime.InteropServices.Swift/SwiftIndirectResult.xml +++ b/xml/System.Runtime.InteropServices.Swift/SwiftIndirectResult.xml @@ -26,14 +26,14 @@ Represents the Swift return buffer context. - This struct is used to access the return buffer when interoping with Swift functions that return non-frozen structs. - It provides a pointer to the memory location where the result should be stored. + This struct is used to access the return buffer when interoping with Swift functions that return non-frozen structs. It provides a pointer to the memory location where the result should be stored. Here's an example of how a SwiftIndirectResult can be declared: - + [UnmanagedCallConv(CallConvs = [typeof(CallConvSwift)])] [LibraryImport("SwiftLibrary", EntryPoint = "export")] public static extern void swiftFunction(SwiftIndirectResult result); - + + diff --git a/xml/System.Runtime.InteropServices.Swift/SwiftSelf.xml b/xml/System.Runtime.InteropServices.Swift/SwiftSelf.xml index 93a851127e9..1848f086d69 100644 --- a/xml/System.Runtime.InteropServices.Swift/SwiftSelf.xml +++ b/xml/System.Runtime.InteropServices.Swift/SwiftSelf.xml @@ -26,12 +26,14 @@ Represents the Swift 'self' context, indicating that the argument is the self context. - - This struct is used to pass the 'self' context to Swift functions in the context of interop with .NET. - - Here's an example of how a SwiftSelf context can be declared: - [UnmanagedCallConv(CallConvs = [typeof(CallConvSwift)])] [DllImport("SwiftLibrary", EntryPoint = "export")] public static extern void swiftFunction(SwiftSelf self); - + This struct is used to pass the 'self' context to Swift functions in the context of interop with .NET. + Here's an example of how a SwiftSelf context can be declared: + + [UnmanagedCallConv(CallConvs = [typeof(CallConvSwift)])] + [DllImport("SwiftLibrary", EntryPoint = "export")] + public static extern void swiftFunction(SwiftSelf self); + + diff --git a/xml/System.Runtime.InteropServices.Swift/SwiftSelf`1.xml b/xml/System.Runtime.InteropServices.Swift/SwiftSelf`1.xml index bfc761a6b61..00a1f5c083a 100644 --- a/xml/System.Runtime.InteropServices.Swift/SwiftSelf`1.xml +++ b/xml/System.Runtime.InteropServices.Swift/SwiftSelf`1.xml @@ -38,12 +38,14 @@ The type of the frozen struct to pass in the 'self' context. Represents the Swift 'self' context when the argument is Swift frozen struct T, which is either enregistered into multiple registers, or passed by reference in the 'self' register. - - This struct is used to pass the Swift frozen struct T to Swift functions in the context of interop with .NET. - - Here's an example of how a SwiftSelf<T> context can be declared: - [UnmanagedCallConv(CallConvs = [typeof(CallConvSwift)])] [LibraryImport("SwiftLibrary", EntryPoint = "export")] public static extern void swiftFunction(SwiftSelf<T> self); - + This struct is used to pass the Swift frozen struct T to Swift functions in the context of interop with .NET. + Here's an example of how a SwiftSelf<T> context can be declared: + + [UnmanagedCallConv(CallConvs = [typeof(CallConvSwift)])] + [LibraryImport("SwiftLibrary", EntryPoint = "export")] + public static extern void swiftFunction(SwiftSelf<T> self); + + From e23d7f804bd263b7b560fb06345a6a5efd163478 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 23 Apr 2025 19:07:13 -0700 Subject: [PATCH 10/16] add language slugs (#11221) --- .../SrgsDocument.xml | 1 - .../SrgsOneOf.xml | 9 +-- .../SrgsRuleRef.xml | 8 +- .../SrgsSemanticInterpretationTag.xml | 13 +--- .../SrgsToken.xml | 3 +- xml/System.Speech.Recognition/Choices.xml | 2 - xml/System.Speech.Recognition/Grammar.xml | 24 ------ .../GrammarBuilder.xml | 37 ---------- .../RecognizedWordUnit.xml | 5 -- .../RecognizerInfo.xml | 7 +- .../SemanticResultKey.xml | 2 - .../SemanticResultValue.xml | 10 +-- .../SemanticValue.xml | 4 - .../SubsetMatchingMode.xml | 2 +- .../SpeechEventInfo.xml | 74 +++++++++---------- .../SpeechSynthesizer.xml | 24 +----- 16 files changed, 55 insertions(+), 170 deletions(-) diff --git a/xml/System.Speech.Recognition.SrgsGrammar/SrgsDocument.xml b/xml/System.Speech.Recognition.SrgsGrammar/SrgsDocument.xml index 1feea779732..22d8dbd8398 100644 --- a/xml/System.Speech.Recognition.SrgsGrammar/SrgsDocument.xml +++ b/xml/System.Speech.Recognition.SrgsGrammar/SrgsDocument.xml @@ -253,7 +253,6 @@ Console.WriteLine("Root Rule " + bookFlight.Root.Id); Grammar g = new Grammar(bookFlight); g.Name = ("City Chooser"); recognizer.LoadGrammarAsync(g); - ``` ]]> diff --git a/xml/System.Speech.Recognition.SrgsGrammar/SrgsOneOf.xml b/xml/System.Speech.Recognition.SrgsGrammar/SrgsOneOf.xml index 4d3a38dfa35..407de79d273 100644 --- a/xml/System.Speech.Recognition.SrgsGrammar/SrgsOneOf.xml +++ b/xml/System.Speech.Recognition.SrgsGrammar/SrgsOneOf.xml @@ -89,10 +89,9 @@ ## Examples The following example uses the element to build lists of elements containing country/region names, any one of which may be used to recognize the containing phrase. The example then adds one of the resulting objects to their respective rules for European and South American countries/regions. Further on, the example uses the object to group rule references to `ruleEurope` and `ruleSAmerica` into a list of two alternatives, either one of which may be used to recognize spoken input. -``` +```csharp public void WorldSoccerWinners () { - // Create an SrgsDocument, create a new rule // and set its scope to public. SrgsDocument document = new SrgsDocument(); @@ -121,7 +120,6 @@ public void WorldSoccerWinners () document.Rules.Add(new SrgsRule[] {winnerRule, ruleEurope, ruleSAmerica}); document.Root = winnerRule; } - ``` ]]> @@ -236,7 +234,7 @@ public void WorldSoccerWinners () ## Examples The following example creates a grammar that recognizes the phrase "A nation that has won the World Cup is" followed by the name of a country/region that has won the World Cup. The example uses the element to build lists of acceptable country/region names from an array of objects. The example then adds one of the resulting objects to their respective rules for European and South American countries/regions. -``` +```csharp public void WorldSoccerWinners () { // Create a grammar from an SRGSDocument, create a new rule @@ -305,10 +303,9 @@ public void WorldSoccerWinners () ## Examples The following example creates a grammar that recognizes the phrase "A nation that has won the World Cup is" followed by the name of a country/region that has won the World Cup. The example uses the object to build lists of acceptable country/region names from an array of objects. Using the method, the example appends an that contains the string "Italy" to the object `oneOfEurope`. -``` +```csharp public void WorldSoccerWinners () { - // Create an SrgsDocument, create a new rule // and set its scope to public. SrgsDocument document = new SrgsDocument(); diff --git a/xml/System.Speech.Recognition.SrgsGrammar/SrgsRuleRef.xml b/xml/System.Speech.Recognition.SrgsGrammar/SrgsRuleRef.xml index 2391fd4a7fa..123c701fe1f 100644 --- a/xml/System.Speech.Recognition.SrgsGrammar/SrgsRuleRef.xml +++ b/xml/System.Speech.Recognition.SrgsGrammar/SrgsRuleRef.xml @@ -105,7 +105,7 @@ ## Examples The following example creates a grammar that recognizes the phrase "A nation that has won the World Cup is" followed by the name of a country that has won the World Cup. After creating the object `winnerRule` and giving it the string identifier `WorldCupWinner`, the example appends the string "A nation that has won the World Cup is" to the rule. Using objects, the example then builds a list of European countries/regions and a list of South American countries/regions, and adds each list to its respective rule, `ruleEurope` or `ruleSAmerica`. The example then creates rule references for `ruleEurope` and `ruleSAmerica` and adds them to the `WorldCupWinner` rule. -``` +```csharp public void WorldSoccerWinners () { @@ -141,7 +141,7 @@ public void WorldSoccerWinners () The created grammar has the following form. -``` +```xml A nation that has won the world cup is @@ -218,7 +218,7 @@ public void WorldSoccerWinners () The second method, `CreateGrammarForRoute`, creates an element named `grammar` with a rule reference specified by the `Uri` passed to it by `GrammarUrlForRoute`. Note that the variable named _route is a member of an enclosing class. -``` +```csharp private Uri GrammarUrlForRoute(string route) { return new Uri("http://localhost/MyBus/MyBusLocations.grxml#LocationsForRoute" + route); @@ -292,7 +292,7 @@ private SrgsDocument CreateGrammarForRoute() ## Examples The following example creates a grammar for choosing the cities for a flight. The example constructs two instances, each of which specifies a semantic key. Both rule references target the same object, named `cities`, but tag the recognition result from the rule reference with a different semantic key. The semantic key identifies a recognized city as the departure city or the arrival city for the flight. The handler for the event uses the keys to retrieve the semantics values created using from the recognition result. -``` +```csharp using System; using System.Speech.Recognition; using System.Speech.Recognition.SrgsGrammar; diff --git a/xml/System.Speech.Recognition.SrgsGrammar/SrgsSemanticInterpretationTag.xml b/xml/System.Speech.Recognition.SrgsGrammar/SrgsSemanticInterpretationTag.xml index 0623d56e580..fa1d92efde8 100644 --- a/xml/System.Speech.Recognition.SrgsGrammar/SrgsSemanticInterpretationTag.xml +++ b/xml/System.Speech.Recognition.SrgsGrammar/SrgsSemanticInterpretationTag.xml @@ -38,16 +38,12 @@ ## Remarks The default semantic format for System.Speech conforms to the W3C [Semantic Interpretation for Speech Recognition (SISR) Version 1.0](https://www.w3.org/TR/semantic-interpretation/), where the format for `tag` elements that contain script is `semantics/1.0`. You must specify the script for objects using this format. In the syntax of `semantics/1.0`: -- The Rule Variable of the containing rule element is identified by "out". - -- The name of the object that has access to the Rule Variable of rule elements outside the containing rule element is identified by "rules". - -- The result from the latest referenced rule that matches the utterance can be represented by "rules.latest()". +- The Rule Variable of the containing rule element is identified by "out". +- The name of the object that has access to the Rule Variable of rule elements outside the containing rule element is identified by "rules". +- The result from the latest referenced rule that matches the utterance can be represented by "rules.latest()". You can also associate a semantic value with a phrase in a grammar without using script, using the object. - - ## Examples The following example creates a grammar for choosing the cities for a flight. The example uses to assign a semantic value to each city, which is the code for the city's airport. The example also uses to assign a separate semantic key for each of the two references made by the object named `cityRef` to the object named `cities`. The semantic keys identify a recognized city as the departure city or the arrival city for the flight. The handler for the event uses the keys to retrieve the semantics from the recognition result. @@ -55,7 +51,7 @@ The expression "rules.flightCities" refers to the Rule Variable on the rule whose is `flightCities`, and which is the target of a rule reference. In the example, the expression "out.LeavingFrom=rules.flightCities;" assigns the value from the rule whose is `flightCities` to the property named `LeavingFrom` of the Rule Variable on the rule named `bookFlight`. See [Semantic Results Content](https://msdn.microsoft.com/library/622291af-615c-4a15-9014-2933aa3f89fe), [Grammar Rule Name Referencing](https://msdn.microsoft.com/library/0777e975-8665-4cc3-957b-752743cb1bb9), and [Grammar Rule Reference Referencing](https://msdn.microsoft.com/library/dec3a809-9aa2-4139-893f-3a549ca1e03e) for more information. -``` +```csharp using System; using System.Speech.Recognition; using System.Speech.Recognition.SrgsGrammar; @@ -136,7 +132,6 @@ namespace SampleRecognition } } } - ``` The following is the XML form of the grammar generated by the code in the example above. diff --git a/xml/System.Speech.Recognition.SrgsGrammar/SrgsToken.xml b/xml/System.Speech.Recognition.SrgsGrammar/SrgsToken.xml index fe09f9c93f3..63c739babd6 100644 --- a/xml/System.Speech.Recognition.SrgsGrammar/SrgsToken.xml +++ b/xml/System.Speech.Recognition.SrgsGrammar/SrgsToken.xml @@ -161,7 +161,7 @@ ## Examples The grammar in the following example contains slang words and also has an uncommon word: "whatchamacallit". Adding a custom, inline pronunciation using the property of the class can improve the accuracy of recognition for the word "whatchamacallit" as well as for the entire phrase that contains it. The example uses phones from the Microsoft Universal Phone Set (UPS) to define the custom pronunciations. -``` +```csharp using System; using System.Speech.Recognition; using System.Speech.Recognition.SrgsGrammar; @@ -236,7 +236,6 @@ namespace SampleRecognition } } } - ``` ]]> diff --git a/xml/System.Speech.Recognition/Choices.xml b/xml/System.Speech.Recognition/Choices.xml index 92746c188ca..941957b4fd6 100644 --- a/xml/System.Speech.Recognition/Choices.xml +++ b/xml/System.Speech.Recognition/Choices.xml @@ -551,7 +551,6 @@ public Grammar CreatePhonePhrase() The following example creates a speech recognition grammar for changing the background color. ```csharp - private Grammar CreateColorChoice() { @@ -569,7 +568,6 @@ private Grammar CreateColorChoice() return grammar; } - ``` ]]> diff --git a/xml/System.Speech.Recognition/Grammar.xml b/xml/System.Speech.Recognition/Grammar.xml index 0be1cdd3250..d14c215269a 100644 --- a/xml/System.Speech.Recognition/Grammar.xml +++ b/xml/System.Speech.Recognition/Grammar.xml @@ -65,11 +65,9 @@ private static Grammar CreateGrammarFromFile() citiesGrammar.Name = "SRGS File Cities Grammar"; return citiesGrammar; } - ``` ```xml - @@ -469,11 +464,9 @@ private static Grammar CreateGrammarFromFile() citiesGrammar.Name = "SRGS File Cities Grammar"; return citiesGrammar; } - ``` ```xml - @@ -801,7 +791,6 @@ namespace SampleRecognition The following example loads a local SRGS file (cities.xml) from a file and specifies a rule to use as the root of the grammar. The content of the cities.xml file appears in the XML example that follows the C# example. ```csharp - // Load a cities grammar from a local file, use a specific // rule as the root of the grammar, and return the new grammar. private static Grammar CreateGrammarFromFile2() @@ -813,7 +802,6 @@ private static Grammar CreateGrammarFromFile2() ``` ```xml - that contains a relative rule reference to the cities.xml file, and specifies a URI to use to resolve the rule reference. The content of the cities.xml file appears in the XML example that follows the C# example. ```csharp - private static Grammar CreateSrgsDocumentGrammar3() { // Create the SrgsDocument. @@ -1163,11 +1147,9 @@ private static Grammar CreateSrgsDocumentGrammar3() return citiesGrammar; } - ``` ```xml - object to the [console](https://go.microsoft.com/fwlink/?LinkId=159613). ```csharp - private static void DumpGrammarStatus(Grammar item) { Console.WriteLine("Grammar name is {0}:", item.Name); @@ -1498,7 +1479,6 @@ private static void DumpGrammarStatus(Grammar item) The following example writes information about a object to the [console](https://go.microsoft.com/fwlink/?LinkId=159613). ```csharp - private static void DumpGrammarStatus(Grammar item) { Console.WriteLine("Grammar name is {0}:", item.Name); @@ -1600,7 +1580,6 @@ private static void DumpGrammarStatus(Grammar item) The following example creates two objects, one for digits and one for fractions. The Grammar objects are assigned names and relative weights and priorities, and loaded by an in-process speech recognizer. The `CreateDigitsGrammar`, `CreateFractionsGrammar`, and `recognizer_SpeechRecognized` methods are not shown here. ```csharp - // Create a Grammar for recognizing numeric digits. Grammar digitsGrammar = CreateDigitsGrammar(); digitsGrammar.Name = "Digits Grammar"; @@ -1673,7 +1652,6 @@ recognizer.RecognizeAsync(RecognizeMode.Multiple); The following example creates two objects, one for digits and one for fractions. The objects are assigned names and relative weights and priorities, and loaded by an in-process speech recognizer. The `CreateDigitsGrammar`, `CreateFractionsGrammar`, and `recognizer_SpeechRecognized` methods are not shown here. ```csharp - // Create a Grammar for recognizing numeric digits. Grammar digitsGrammar = CreateDigitsGrammar(); digitsGrammar.Name = "Digits Grammar"; @@ -1782,7 +1760,6 @@ recognizer.RecognizeAsync(RecognizeMode.Multiple); The following example writes information about a object to the [console](https://go.microsoft.com/fwlink/?LinkId=159613). ```csharp - private static void DumpGrammarStatus(Grammar item) { Console.WriteLine("Grammar name is {0}:", item.Name); @@ -1963,7 +1940,6 @@ public partial class Form1 : Form The following example creates two objects, one for digits and one for fractions. The objects are assigned names and relative weights and priorities, and loaded by an in-process speech recognizer. The `CreateDigitsGrammar`, `CreateFractionsGrammar`, and `recognizer_SpeechRecognized` methods are not shown here. ```csharp - // Create a Grammar for recognizing numeric digits. Grammar digitsGrammar = CreateDigitsGrammar(); digitsGrammar.Name = "Digits Grammar"; diff --git a/xml/System.Speech.Recognition/GrammarBuilder.xml b/xml/System.Speech.Recognition/GrammarBuilder.xml index 6cdd7ab33e5..3dd828b8e1a 100644 --- a/xml/System.Speech.Recognition/GrammarBuilder.xml +++ b/xml/System.Speech.Recognition/GrammarBuilder.xml @@ -62,7 +62,6 @@ The example finally creates a object from a constructed from a object. ```csharp - private Grammar CreateColorGrammar() { @@ -83,7 +82,6 @@ private Grammar CreateColorGrammar() grammar.Name = "backgroundColor"; return grammar; } - ``` ]]> @@ -157,7 +155,6 @@ private Grammar CreateColorGrammar() The example finally creates a object from a constructed from a object. ```csharp - private Grammar CreateColorGrammar() { @@ -180,7 +177,6 @@ private Grammar CreateColorGrammar() grammar.Name = "backgroundColor"; return grammar; } - ``` ]]> @@ -227,7 +223,6 @@ private Grammar CreateColorGrammar() The example finally creates a object from a constructed from a object. ```csharp - private Grammar CreateColorGrammar() { @@ -248,7 +243,6 @@ private Grammar CreateColorGrammar() grammar.Name = "backgroundColor"; return grammar; } - ``` ]]> @@ -298,7 +292,6 @@ private Grammar CreateColorGrammar() The example uses , , , , and objects to build the constraints that are all contained in the last object, `bothPhrases`. Finally, the example constructs a object from the completed . ```csharp - private Grammar CreateColorGrammar() { @@ -390,7 +383,6 @@ private Grammar CreateColorGrammar() The example uses , , , , and objects to build the constraints that are all contained in the last object, `bothPhrases`. Finally, the example constructs a object from the completed . ```csharp - private Grammar CreateColorGrammar() { @@ -479,7 +471,6 @@ private Grammar CreateColorGrammar() The example finally creates a object from a object cast to a object. ```csharp - private Grammar CreateColorGrammar() { @@ -500,7 +491,6 @@ private Grammar CreateColorGrammar() grammar.Name = "backgroundColor"; return grammar; } - ``` ]]> @@ -547,7 +537,6 @@ private Grammar CreateColorGrammar() The following example creates a speech recognition grammar for each value and a grammar for choosing between the matching mode grammars. If the value of `phrase` is "one two three four five six seven", then the Subsequence grammar recognizes the input "two three four", but not the input "one three five". However, the Ordered Subset grammar recognizes both of these inputs. ```csharp - private static IEnumerable CreateMatchingModeGrammars(string phrase) { @@ -645,7 +634,6 @@ private static string BreakAtCaps(string item) The following example creates a speech recognition grammar for ordering a pizza. It starts with an optional, opening phrase, followed by one to four toppings, and closes with the word "pizza". ```csharp - private static Grammar CreatePizzaGrammar() { @@ -716,7 +704,6 @@ private static Grammar CreatePizzaGrammar() The following example creates a speech recognition grammar for ordering a pizza. It starts with an optional, opening phrase, followed by one to four toppings, and closes with the word "pizza". ```csharp - private static Grammar CreatePizzaGrammar() { @@ -880,7 +867,6 @@ private static Grammar CreatePizzaGrammar() The following example creates a speech recognition grammar that can recognize the two phrases, "Make background *color*" and "Set background to *color*", where *color* is selected from a set of colors. Various types are used to build the final grammar, such as [String](https://go.microsoft.com/fwlink/?LinkId=159733), , and objects. The explicit cast operators in the calls to the methods are optional. ```csharp - private Grammar CreateColorGrammar() { @@ -964,7 +950,6 @@ private Grammar CreateColorGrammar() The following example creates a speech recognition grammar that can recognize the two phrases, "Make background *color*" and "Set background to *color*", where *color* is selected from a set of colors. Various types are used to build the final grammar, such as [String](https://go.microsoft.com/fwlink/?LinkId=159733), , and objects. The explicit cast operators in the calls to the methods are optional. ```csharp - private Grammar CreateColorGrammar() { @@ -1045,7 +1030,6 @@ private Grammar CreateColorGrammar() The following example creates a speech recognition grammar that can recognize the two phrases, "Make background *color*" and "Set background to *color*", where *color* is selected from a set of colors. Various types are used to build the final grammar, such as [String](https://go.microsoft.com/fwlink/?LinkId=159733), , and objects. The explicit cast operators in the calls to the methods are optional. ```csharp - private Grammar CreateColorGrammar() { @@ -1126,7 +1110,6 @@ private Grammar CreateColorGrammar() The following example creates a speech recognition grammar that can recognize the two phrases, "Make background *color*" and "Set background to *color*", where *color* is selected from a set of colors. Various types are used to build the final grammar, such as [String](https://go.microsoft.com/fwlink/?LinkId=159733), , and objects. The explicit cast operators in the calls to the methods are optional. ```csharp - private Grammar CreateColorGrammar() { @@ -1219,7 +1202,6 @@ private Grammar CreateColorGrammar() The following example creates a speech recognition grammar for phrases such as "Call James at work" and "Call Anne on her cell phone", where the word "phone" is optional. The example highlights the use of the method. ```csharp - public static Grammar CreatePhonePhrase() { // Create alternatives for person names, locations, devices, and pronouns. @@ -1297,7 +1279,6 @@ public static Grammar CreatePhonePhrase() The following example creates a speech recognition grammar for phrases such as "Call James at work" and "Call Anne on her cell phone", where the word "phone" is optional. and objects are used to construct the grammar. The example highlights the use of the method. ```csharp - public static Grammar CreatePhonePhrase() { // Create alternatives for person names, locations, devices, and pronouns. @@ -1450,7 +1431,6 @@ namespace SampleRecognition } } } - ``` ]]> @@ -1498,7 +1478,6 @@ namespace SampleRecognition The following example is part of a console application for choosing origin and destination cities for a flight. The application recognizes phrases such as "I want to fly from Miami to Chicago." The handler for the event uses the to extract the airport code specified in the for the origin and destination cities. ```csharp - using System; using System.Speech.Recognition; @@ -1582,7 +1561,6 @@ namespace SampleRecognition } } } - ``` ]]> @@ -1667,7 +1645,6 @@ namespace SampleRecognition The following example creates a speech recognition grammar for each value. For example, the generated grammar `OrderedSubset` recognizes the phrases, "three four five" and "one three five", and the grammar `Subsequence` recognizes the phrase "three four five", but not the phrase, "one three five". ```csharp - private Grammar[] CreateSubsetMatchTest() { List grammars = new List(4); @@ -1737,7 +1714,6 @@ private Grammar[] CreateSubsetMatchTest() The following example creates a speech recognition grammar for phrases such as "Call James at work" and "Call Anne on her cell phone", where the word "phone" is optional. and objects are used to construct the grammar. The example highlights the use of the method. ```csharp - public static Grammar CreatePhonePhrase() { // Create alternatives for person names, locations, devices, and pronouns. @@ -1819,7 +1795,6 @@ public static Grammar CreatePhonePhrase() The following example creates a speech recognition grammar for phrases such as "Call James at work" and "Call Anne on her cell phone", where the word "phone" is optional. and objects are used to construct the grammar. The example highlights the use of the method. ```csharp - public static Grammar CreatePhonePhrase() { // Create alternatives for person names, locations, devices, and pronouns. @@ -1913,7 +1888,6 @@ public static Grammar CreatePhonePhrase() The following example creates a speech recognition grammar that incorporates dictation. ```csharp - GrammarBuilder builder = new GrammarBuilder(); builder.Append("begin"); builder.AppendDictation(); @@ -1964,7 +1938,6 @@ grammarWithDictation.Name = "Grammar with Dictation"; The following example creates a speech recognition grammar that incorporates the spelling dictation grammar rules. ```csharp - GrammarBuilder builder = new GrammarBuilder(); builder.Append("begin"); builder.AppendDictation("spelling"); @@ -2040,7 +2013,6 @@ grammarWithDictation.Name = "Grammar with Dictation"; The following C# example creates a speech recognition grammar that uses the rule named `Cities` in a local SRGS file, cities.grxml. The content of the cities.grxml file appears below the C# code example. ```csharp - private static Grammar CreateCitiesGrammar1() { GrammarBuilder builder = new GrammarBuilder(); @@ -2053,7 +2025,6 @@ private static Grammar CreateCitiesGrammar1() ``` ```xml - object's culture to English (United States). ```csharp - private static Grammar CreatePizzaGrammar() { @@ -2411,7 +2379,6 @@ private static Grammar CreatePizzaGrammar() - `GrammarBuilder status: I would like a [cheese,mushroom,tomato,onion,anchovy,chic ken,pepperoni] and [cheese,mushroom,tomato,onion,anchovy,chicken,pepperoni] pizza` ```csharp - private static Grammar CreatePizzaGrammar() { @@ -2582,7 +2549,6 @@ private static Grammar CreatePizzaGrammar() The following example creates a speech recognition grammar that can recognize the two phrases, "Make background *color*" and "Set background to *color*", where *color* is selected from a set of colors. Various types are used to build the final grammar, such as [String](https://go.microsoft.com/fwlink/?LinkId=159733), , and objects. ```csharp - private Grammar CreateColorGrammar() { @@ -2777,7 +2743,6 @@ private Grammar CreateColorGrammar() The following example creates a speech recognition grammar that can recognize the two phrases, "Make background *color*" and "Set background to *color*", where *color* is selected from a set of colors. Various types are used to build the final grammar, such as [String](https://go.microsoft.com/fwlink/?LinkId=159733), , and objects. ```csharp - private Grammar CreateColorGrammar() { @@ -2940,7 +2905,6 @@ SemanticResultKey yesnoKey = Grammar yesnoGrammar = new Grammar(yesnoKey); yesnoGrammar.Name = "yesno"; - ``` ]]> @@ -2997,7 +2961,6 @@ SemanticResultKey yesnoKey = Grammar yesnoGrammar = new Grammar(yesnoKey); yesnoGrammar.Name = "yesno"; - ``` ]]> diff --git a/xml/System.Speech.Recognition/RecognizedWordUnit.xml b/xml/System.Speech.Recognition/RecognizedWordUnit.xml index 93a34e89b96..cb5a9c45d7a 100644 --- a/xml/System.Speech.Recognition/RecognizedWordUnit.xml +++ b/xml/System.Speech.Recognition/RecognizedWordUnit.xml @@ -54,7 +54,6 @@ The following example shows a utility routine (`stringFromWordArray`) that generates strings. The strings contain lexical output (using ), normalized text (using ), or phonetic characters from the International Phonetic Alphabet (using ). Strings are formatted using objects obtained from the property from a of objects. The objects are obtained from the property on the object. ```csharp - internal enum WordType { Text, @@ -312,7 +311,6 @@ private void _emulateAndVerify_Click(object sender, EventArgs e) The following example shows a utility routine (`stringFromWordArray`) that generates a string that is formatted in one of three ways: lexically (using ), normalized (using ), or phonetically (using ). The text output is obtained from the property on a of objects, which is obtained from the property on a object. ```csharp - internal enum WordType { Text, @@ -417,7 +415,6 @@ internal static string stringFromWordArray( The following example shows a utility routine that generates text in one of three formats: lexical (using ), normalized (using ), and phonetic (using ). The text output is obtained from a of objects, which is obtained from the property on the object. ```csharp - internal enum WordType { Text, @@ -524,7 +521,6 @@ internal static string stringFromWordArray( The following example shows a utility routine that generates a string with one of three possible formats: lexical (using ), normalized (using ), and phonetic (using ). The text output is obtained from a of objects, which is obtained from the property on the object. ```csharp - internal enum WordType { Text, @@ -629,7 +625,6 @@ internal static string stringFromWordArray( The following example shows a utility routine that generates a string in one of three formats: lexical (using ), normalized (using ), and phonetic (using ). The text output is obtained from a of objects, which is obtained from the property on the object. ```csharp - internal enum WordType { Text, diff --git a/xml/System.Speech.Recognition/RecognizerInfo.xml b/xml/System.Speech.Recognition/RecognizerInfo.xml index c1b3c3e55d2..760b246450f 100644 --- a/xml/System.Speech.Recognition/RecognizerInfo.xml +++ b/xml/System.Speech.Recognition/RecognizerInfo.xml @@ -50,7 +50,6 @@ If the and identifier string are valid, the example creates a new instance of using the instance as an argument. ```csharp - private SpeechRecognitionEngine SelectRecognizer(CultureInfo requiredCulture, string requiredId) { // Select based on a specific recognizer configuration @@ -352,7 +351,7 @@ private void recognizerInfoButton_Click(object sender, EventArgs e) ## Examples The following example implements a button click that displays all the information in a instance. The example uses the property to obtain the identifier string of a recognition engine configuration, and then displays it in a . -``` +```csharp private void recognizerInfoButton_Click(object sender, EventArgs e) { RecognizerInfo info = _recognizer.RecognizerInfo; @@ -421,7 +420,7 @@ private void recognizerInfoButton_Click(object sender, EventArgs e) ## Examples The following example implements a button click that displays all the information in a instance. The example uses the property to obtain the friendly name of a recognition engine configuration, and then displays it in a . -``` +```csharp private void recognizerInfoButton_Click(object sender, EventArgs e) { RecognizerInfo info = _recognizer.RecognizerInfo; @@ -490,7 +489,7 @@ private void recognizerInfoButton_Click(object sender, EventArgs e) ## Examples The following example implements a button click that displays all the information in a instance. The example uses the property to obtain the encoding formats supported by a recognition engine configuration, and then displays it in a . -``` +```csharp private void recognizerInfoButton_Click(object sender, EventArgs e) { RecognizerInfo info = _recognizer.RecognizerInfo; diff --git a/xml/System.Speech.Recognition/SemanticResultKey.xml b/xml/System.Speech.Recognition/SemanticResultKey.xml index 36a213a8ac4..e3c0d8121db 100644 --- a/xml/System.Speech.Recognition/SemanticResultKey.xml +++ b/xml/System.Speech.Recognition/SemanticResultKey.xml @@ -343,7 +343,6 @@ private void keyTest() A is then obtained by calling on a instance, which will be used to key the semantic choices in `colorChoice`. ```csharp - private Grammar CreateGrammarBuilderRGBSemantics() { @@ -374,7 +373,6 @@ private Grammar CreateGrammarBuilderRGBSemantics() return grammar; } - ``` ]]> diff --git a/xml/System.Speech.Recognition/SemanticResultValue.xml b/xml/System.Speech.Recognition/SemanticResultValue.xml index 312eccfde93..820ba607829 100644 --- a/xml/System.Speech.Recognition/SemanticResultValue.xml +++ b/xml/System.Speech.Recognition/SemanticResultValue.xml @@ -87,8 +87,7 @@ SemanticResultKey fgOrbgChoiceKey = new SemanticResultKey("BgOrFgText", fgOrbgCh ## Examples The following example returns a that recognizes the command "Set/Change/Alter Foreground/Background … [color list]". and instances (in conjunction with and objects) are used to define semantics that can be parsed on recognition. The parsed semantics will determine which color was requested and whether the foreground or background is to be modified. -``` - +```csharp private Grammar FgBgColorGrammar() { Grammar grammar = null; @@ -204,7 +203,6 @@ backgroundGB.Append(new SemanticResultValue(true)); The following example returns a that recognizes the command "Set/Change/Alter Foreground/Background … [color list]". and instances (in conjunction with and objects) are used to define semantics that can be parsed on recognition. The parsed semantics will determine which color was requested and whether the foreground or background is to be modified. ```csharp - private Grammar FgBgColorGrammar() { Grammar grammar = null; @@ -301,7 +299,6 @@ myGb.Append(new SemanticResultValue(myChoice, true); The following example returns a that recognizes the command "Set/Change/Alter Foreground/Background … [color list]". and instances (in conjunction with and objects) are used to define semantics that can be parsed on recognition. The parsed semantics will determine which color was requested and whether the foreground or background is to be modified. ```csharp - private Grammar FgBgColorGrammar() { Grammar grammar = null; @@ -394,7 +391,7 @@ myGb.Append(new SemanticResultValue("my mortgage", true); ## Examples The following example returns a that recognizes the command "Set/Change/Alter Foreground/Background … [color list]". and instances (in conjunction with and objects) are used to define semantics that can be parsed on recognition. The parsed semantics will determine which color was requested and whether the foreground or background is to be modified. -``` +```csharp private Grammar FgBgColorGrammar() { Grammar grammar = null; @@ -442,7 +439,6 @@ private Grammar FgBgColorGrammar() grammar.Name = "Tree [Set,change,alter] [foreground,background] * color"; return grammar; } - ``` ]]> @@ -486,7 +482,6 @@ private Grammar FgBgColorGrammar() A is then obtained by calling on a instance, which will be used to key the semantic choices in the `colorChoice` instance. ```csharp - private Grammar CreateGrammarBuilderRGBSemantics() { @@ -520,7 +515,6 @@ private Grammar CreateGrammarBuilderRGBSemantics() return grammar; } - ``` ]]> diff --git a/xml/System.Speech.Recognition/SemanticValue.xml b/xml/System.Speech.Recognition/SemanticValue.xml index 63f96a96900..7d292d4b7e4 100644 --- a/xml/System.Speech.Recognition/SemanticValue.xml +++ b/xml/System.Speech.Recognition/SemanticValue.xml @@ -112,7 +112,6 @@ In other cases, the handler uses keys to obtain the RGB components of a color name, to determine whether the command will change the foreground or background, or to indicate that no valid key was found. ```csharp - newGrammar.SpeechRecognized += delegate(object sender, SpeechRecognizedEventArgs eventArgs) { @@ -455,7 +454,6 @@ internal static void CreateSemanticsTreeNodes( After handling phrases that are recognized but have no semantic structure, the handler checks for the presence of appropriate keys using (`applyChgToBackground`, `colorRGBValueList`, or `colorStringList)`, and then processes the semantically organized data. ```csharp - newGrammar.SpeechRecognized += delegate(object sender, SpeechRecognizedEventArgs eventArgs) { @@ -597,7 +595,6 @@ newGrammar.SpeechRecognized += In other cases, the handler uses keys to obtain the RGB components of a color name, to determine whether the command will change the foreground or background, or to indicate that no valid key was found. ```csharp - newGrammar.SpeechRecognized += delegate(object sender, SpeechRecognizedEventArgs eventArgs) { @@ -803,7 +800,6 @@ newGrammar.SpeechRecognized += The use of is highlighted below. ```csharp - newGrammar.SpeechRecognized += delegate(object sender, SpeechRecognizedEventArgs eventArgs) { diff --git a/xml/System.Speech.Recognition/SubsetMatchingMode.xml b/xml/System.Speech.Recognition/SubsetMatchingMode.xml index dfbd036abbe..0a85cd8a4ce 100644 --- a/xml/System.Speech.Recognition/SubsetMatchingMode.xml +++ b/xml/System.Speech.Recognition/SubsetMatchingMode.xml @@ -112,7 +112,7 @@ Following is a test routine that generates four objects, using the same phrase, for each of the `SubsetMatchingModes`. These objects can then be tested. -``` +```csharp private void CreateSubsetMatchTest() { foreach ( System.Speech.Recognition.SubsetMatchingMode mode diff --git a/xml/System.Speech.Synthesis.TtsEngine/SpeechEventInfo.xml b/xml/System.Speech.Synthesis.TtsEngine/SpeechEventInfo.xml index be9db58db69..17d2b848ddf 100644 --- a/xml/System.Speech.Synthesis.TtsEngine/SpeechEventInfo.xml +++ b/xml/System.Speech.Synthesis.TtsEngine/SpeechEventInfo.xml @@ -37,24 +37,22 @@ ## Remarks A custom speech synthesis engine requests the generation of events under the Speech Platform by providing an appropriate instance to member of the engine site object passed to implementations 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. +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. -``` +```csharp private const int WordBoundaryFlag = 1 << (int)TtsEventId.WordBoundary; private readonly char[] spaces = new char[] { ' ', '\t', '\r', '\n' }; internal struct UsVsUk @@ -161,17 +159,17 @@ 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. -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 @@ -327,19 +325,19 @@ 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. -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 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; private readonly char[] spaces = new char[] { ' ', '\t', '\r', '\n' }; internal struct UsVsUk @@ -526,19 +524,19 @@ 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. -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 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; private readonly char[] spaces = new char[] { ' ', '\t', '\r', '\n' }; internal struct UsVsUk @@ -637,19 +635,19 @@ 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. -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 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; private readonly char[] spaces = new char[] { ' ', '\t', '\r', '\n' }; internal struct UsVsUk @@ -748,19 +746,19 @@ 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. -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 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; private readonly char[] spaces = new char[] { ' ', '\t', '\r', '\n' }; internal struct UsVsUk diff --git a/xml/System.Speech.Synthesis/SpeechSynthesizer.xml b/xml/System.Speech.Synthesis/SpeechSynthesizer.xml index a6f624016ed..0be3b45585e 100644 --- a/xml/System.Speech.Synthesis/SpeechSynthesizer.xml +++ b/xml/System.Speech.Synthesis/SpeechSynthesizer.xml @@ -54,7 +54,6 @@ The following example is part of a console application that initializes a object and speaks a string. ```csharp - using System; using System.Speech.Synthesis; @@ -80,7 +79,6 @@ namespace SampleSynthesis } } } - ``` ]]> @@ -321,7 +319,6 @@ namespace SampleSynthesis } } } - ``` ]]> @@ -398,17 +395,7 @@ namespace SampleSynthesis Gets the prompt that the is speaking. The prompt object that is currently being spoken. - - - + To be added. @@ -519,7 +506,6 @@ namespace SampleSynthesis } } } - ``` ]]> @@ -621,7 +607,6 @@ namespace SampleSynthesis } } } - ``` ]]> @@ -1170,7 +1155,6 @@ namespace SampleSynthesis } } } - ``` ]]> @@ -1388,7 +1372,6 @@ namespace SampleSynthesis } } } - ``` ]]> @@ -1476,7 +1459,6 @@ namespace SampleSynthesis } } } - ``` ]]> @@ -1910,7 +1892,6 @@ namespace SampleSynthesis } } } - ``` This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . @@ -2120,7 +2101,6 @@ namespace SampleSynthesis } } } - ``` ]]> @@ -2486,7 +2466,6 @@ namespace SampleSynthesis } } } - ``` ]]> @@ -2674,7 +2653,6 @@ namespace SampleSynthesis } } } - ``` ]]> From 830bb9c00d28728f78e7ba84150b88065d92c12b Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 23 Apr 2025 19:12:42 -0700 Subject: [PATCH 11/16] add language slugs (#11222) --- .../AdvancedFilters.xml | 7 ----- .../AuthenticablePrincipal.xml | 7 ++--- .../DirectoryEntry.xml | 1 - .../ServicedComponent.xml | 2 +- .../DefaultPropertiesToSend.xml | 4 +-- xml/System.Messaging/Message.xml | 2 +- xml/System.Messaging/MessageQueue.xml | 9 ++---- .../StronglyTypedResourceBuilder.xml | 2 +- xml/System.Resources/ResXResourceReader.xml | 2 +- xml/System.Resources/ResourceManager.xml | 23 +++++--------- xml/System.Resources/ResourceReader.xml | 31 +++++++------------ 11 files changed, 30 insertions(+), 60 deletions(-) diff --git a/xml/System.DirectoryServices.AccountManagement/AdvancedFilters.xml b/xml/System.DirectoryServices.AccountManagement/AdvancedFilters.xml index 0f518bcee74..30bb22f767b 100644 --- a/xml/System.DirectoryServices.AccountManagement/AdvancedFilters.xml +++ b/xml/System.DirectoryServices.AccountManagement/AdvancedFilters.xml @@ -111,7 +111,6 @@ ## Examples ```csharp - // Create the principal context for the usr object. PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "fabrikam.com", "CN=Users,DC=fabrikam,DC=com", "administrator", "SecurelyStoredPassword"); @@ -175,7 +174,6 @@ foreach (UserPrincipal u in results) ## Examples ```csharp - // Create the principal context for the usr object. PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "fabrikam.com", "CN=Users,DC=fabrikam,DC=com", "administrator", "SecurelyStoredPassword"); @@ -245,7 +243,6 @@ foreach (UserPrincipal u in results) In an extended class, you might implement an advanced search filter for `LogonCount`: ```csharp - public class InetOrgPersonSearchFilter : AdvancedFilters { public InetOrgPersonSearchFilter(Principal p) : base(p) { } @@ -293,7 +290,6 @@ public class InetOrgPersonSearchFilter : AdvancedFilters ## Examples ```csharp - // Create the principal context for the usr object. PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "fabrikam.com", "CN=Users,DC=fabrikam,DC=com", "administrator", "SecurelyStoredPassword"); @@ -355,7 +351,6 @@ foreach (UserPrincipal u in results) ## Examples ```csharp - // Create the principal context for the usr object. PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "fabrikam.com", "CN=Users,DC=fabrikam,DC=com", "administrator", "SecurelyStoredPassword"); @@ -419,7 +414,6 @@ foreach (UserPrincipal u in results) ## Examples ```csharp - // Create the principal context for the usr object. PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "fabrikam.com", "CN=Users,DC=fabrikam,DC=com", "administrator", "SecurelyStoredPassword"); @@ -481,7 +475,6 @@ foreach (UserPrincipal u in results) ## Examples ```csharp - // Create the principal context for the usr object. PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "fabrikam.com", "CN=Users,DC=fabrikam,DC=com", "administrator", "SecurelyStoredPassword"); diff --git a/xml/System.DirectoryServices.AccountManagement/AuthenticablePrincipal.xml b/xml/System.DirectoryServices.AccountManagement/AuthenticablePrincipal.xml index 6137fa93a2c..bddab95c1a8 100644 --- a/xml/System.DirectoryServices.AccountManagement/AuthenticablePrincipal.xml +++ b/xml/System.DirectoryServices.AccountManagement/AuthenticablePrincipal.xml @@ -729,7 +729,7 @@ A search is performed for all authenticable principals under the container "DC=adamApp1,DC=fabrikam,DC=com" that have not logged on to this ADAM instance for the last 45 days. The principals returned by the search are then deleted. -``` +```csharp PrincipalContext ctx = new PrincipalContext( ContextType.ApplicationDirectory, "adamHost1.fabrikam.com:5000", @@ -748,7 +748,6 @@ foreach (Principal p in oldPrincipals) oldPrincipals.Dispose(); ctx.Dispose(); - ``` ]]> @@ -1280,9 +1279,9 @@ ctx.Dispose(); ## Examples The following example code connects to the LDAP domain "fabrikam.com" with the username (administrator) and password (SecretPwd123) initialized in the constructor. - A search is performed to find the user with name "John Smith" under the container specified in the constructor: "CN=Users,DC=fabrikam,DC=com." If the user is found, a check is performed to determine whether this user's account has been locked out. If the account has been locked out, the code example unlocks the account. + A search is performed to find the user with name "John Smith" under the container specified in the constructor: "CN=Users,DC=fabrikam,DC=com." If the user is found, a check is performed to determine whether this user's account has been locked out. If the account has been locked out, the code example unlocks the account. -``` +```csharp PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "fabrikam.com", "CN=Users,DC=fabrikam,DC=com", diff --git a/xml/System.DirectoryServices/DirectoryEntry.xml b/xml/System.DirectoryServices/DirectoryEntry.xml index 1033ae1a90f..89b3f3a102d 100644 --- a/xml/System.DirectoryServices/DirectoryEntry.xml +++ b/xml/System.DirectoryServices/DirectoryEntry.xml @@ -2069,7 +2069,6 @@ if (string.Compare(mySchemaEntry.Name,"container") == 0) foreach(DirectoryEntry myChildDirectoryEntry in myDirectoryEntry.Children) Console.WriteLine(myChildDirectoryEntry.Path); } - ``` ```cpp diff --git a/xml/System.EnterpriseServices/ServicedComponent.xml b/xml/System.EnterpriseServices/ServicedComponent.xml index f148d25275f..bf1aa4ffd84 100644 --- a/xml/System.EnterpriseServices/ServicedComponent.xml +++ b/xml/System.EnterpriseServices/ServicedComponent.xml @@ -52,7 +52,7 @@ To deploy this class as a configured COM component, you must generate a strong key, compile the class as a library, and register the library. These three steps are accomplished by the following three commands. -``` +```console sn -k Calculator.snk csc /t:library Calculator.cs regsvcs Calculator.dll diff --git a/xml/System.Messaging/DefaultPropertiesToSend.xml b/xml/System.Messaging/DefaultPropertiesToSend.xml index fd1d8929dcf..79afe37949b 100644 --- a/xml/System.Messaging/DefaultPropertiesToSend.xml +++ b/xml/System.Messaging/DefaultPropertiesToSend.xml @@ -72,7 +72,7 @@ There are two ways to define a queue's default properties to send, as shown in the following C# code. You can set values for this instance of and associate it with the queue's property: -``` +```csharp DefaultPropertiesToSend myDefaultProperties = new DefaultPropertiesToSend(); // Set default values for the properties. myDefaultProperties.Label = "myLabel"; @@ -84,7 +84,7 @@ DefaultPropertiesToSend myDefaultProperties = new DefaultPropertiesToSend(); Or, you can individually assign values to the instance's property directly: -``` +```csharp myMessageQueue.DefaultPropertiesToSend.Label = "myLabel"; myMessageQueue.DefaultPropertiesToSend.Recoverable = false; ... diff --git a/xml/System.Messaging/Message.xml b/xml/System.Messaging/Message.xml index 2f01ef38a4d..9c683de7e48 100644 --- a/xml/System.Messaging/Message.xml +++ b/xml/System.Messaging/Message.xml @@ -1040,7 +1040,7 @@ Other formatters can provide binding functionality also, as shown in the following C# code. -``` +```csharp message.Formatter = new ActiveXMessageFormatter(); object myObject message.Body; if (myObject is string) { diff --git a/xml/System.Messaging/MessageQueue.xml b/xml/System.Messaging/MessageQueue.xml index 20216db0c75..17189409160 100644 --- a/xml/System.Messaging/MessageQueue.xml +++ b/xml/System.Messaging/MessageQueue.xml @@ -4117,13 +4117,8 @@ The name of the computer is not valid, possibly because the syntax is incorrect. System.String - Introduced in MSMQ 3.0. Gets or sets the multicast address associated with the queue. - A that contains a valid multicast address (in the form shown below) or , which indicates that the queue is not associated with a multicast address. - -``` -<address>:<port> -``` - + Gets or sets the multicast address associated with the queue. + A valid multicast address (in the form <address>:<port>) or , which indicates that the queue is not associated with a multicast address. .",typeof(baseName).Assembly); ``` diff --git a/xml/System.Resources/ResXResourceReader.xml b/xml/System.Resources/ResXResourceReader.xml index 09e646cbaa5..21ebbb29181 100644 --- a/xml/System.Resources/ResXResourceReader.xml +++ b/xml/System.Resources/ResXResourceReader.xml @@ -988,7 +988,7 @@ The resource XML file used by the example contains one data node and one metadata node. To use the XML file with the previous example, copy the following text and save it to a file named Resource1.resx. -``` +```xml diff --git a/xml/System.Resources/ResourceManager.xml b/xml/System.Resources/ResourceManager.xml index bd835b7b6f8..971d88f891c 100644 --- a/xml/System.Resources/ResourceManager.xml +++ b/xml/System.Resources/ResourceManager.xml @@ -893,10 +893,9 @@ ## Examples - The following example calls the method to retrieve culture-specific resources for the French (France) culture. It then enumerates all of the resources in the resource set. It contains the source code for an executable named ShowNumbers.exe. It also includes the following two text file that contain the names of numbers. The first, NumberResources.txt, contains the names of numbers from one to ten in the English language: - -``` + The following example calls the method to retrieve culture-specific resources for the French (France) culture. It then enumerates all of the resources in the resource set. It contains the source code for an executable named ShowNumbers.exe. The example includes two text files that contain the names of numbers. The first, NumberResources.txt, contains the names of numbers from one to ten in the English language: +```txt one=one two=two three=three @@ -907,24 +906,20 @@ seven=seven eight=eight nine=nine ten=ten - ``` The second, NumberResources.fr-FR.txt, contains the names of numbers from one to four in the French language: -``` - +```txt one=un two=deux three=trois four=quatre - ``` You can use a batch file to generate the resource files, embed the English language resource file into the executable, and create a satellite assembly for the French language resources. Here's the batch file to generate an executable by using the Visual Basic compiler: -``` - +```bat resgen NumberResources.txt vbc shownumbers.vb /resource:NumberResources.resources @@ -935,21 +930,19 @@ al /out:fr-FR\ShowNumbers.resources.dll /culture:fr-FR /embed:NumberResources.fr For the C# compiler, you can use the following batch file: -``` - +```bat resgen NumberResources.txt csc shownumbers.cs /resource:NumberResources.resources md fr-FR resgen NumberResources.fr-FR.txt al /out:fr-FR\ShowNumbers.resources.dll /culture:fr-FR /embed:NumberResources.fr-FR.resources - ``` :::code language="csharp" source="~/snippets/csharp/System.Resources/ResourceManager/GetResourceSet/shownumbers.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.resources.resourcemanager.getresourceset/vb/shownumbers.vb" id="Snippet1"::: - Note that if you change the value of the `createIfNotExists` argument to `false`, the method call returns `null`, since Resource Manager has not already loaded the French language resources. +If you change the value of the `createIfNotExists` argument to `false`, the method call returns `null`, since Resource Manager hasn't yet loaded the French language resources. ]]> @@ -1128,15 +1121,13 @@ al /out:fr-FR\ShowNumbers.resources.dll /culture:fr-FR /embed:NumberResources.fr You can use the following batch file to build the C# example. For Visual Basic, change `csc` to `vbc`, and change the extension of the source code file from `.cs` to `.vb`. -``` - +```bat csc CreateResources.cs CreateResources resgen AppResources.resx csc GetStream.cs /resource:AppResources.resources - ``` ]]> diff --git a/xml/System.Resources/ResourceReader.xml b/xml/System.Resources/ResourceReader.xml index f518a152fd7..f428932badb 100644 --- a/xml/System.Resources/ResourceReader.xml +++ b/xml/System.Resources/ResourceReader.xml @@ -174,10 +174,10 @@ [!INCLUDE [untrusted-data-instance-note](~/includes/untrusted-data-instance-note.md)] ## Examples - The example in this section uses the following .txt file named `PatientForm.txt` to define the resources used by an application. -``` +The example in this section uses the following .txt file named `PatientForm.txt` to define the resources used by an application. +```txt Title="Top Pet Animal Clinic" Label1="Patient Number:" Label2="Pet Name:" @@ -190,25 +190,24 @@ Label8="Address:" Label9="Home Phone:" Label10="Work Phone:" Label11="Mobile Phone:" - ``` You can compile the .txt file into a .resources file by issuing the following command: - **resgen PatientForm.txt** +`resgen PatientForm.txt` The following example assumes that the resource file is embedded in the assembly that contains the application's executable code. It retrieves a resource file named `PatientForm.resources` from the currently executing assemblies and displays the name and value of each of its resources. :::code language="csharp" source="~/snippets/csharp/System.Resources/ResourceReader/.ctor/stream1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.resources.resourcereader.ctor/vb/stream1.vb" id="Snippet1"::: - If the C# example is named `Example.cs`, you can compile it by using the following command: +If the C# example is named `Example.cs`, you can compile it by using the following command: - **csc Example.cs /res:PatientForm.resources** +`csc Example.cs /res:PatientForm.resources` - If the Visual Basic example is named `Example.vb`, you can compile it by using the following command: +If the Visual Basic example is named `Example.vb`, you can compile it by using the following command: - **vbc Example.vb /res:PatientForm.resources** +`vbc Example.vb /res:PatientForm.resources` ]]> @@ -279,8 +278,7 @@ Label11="Mobile Phone:" ## Examples The example in this section uses the following .txt file named `PatientForm.txt` to define the resources used by an application. -``` - +```txt Title="Top Pet Animal Clinic" Label1="Patient Number:" Label2="Pet Name:" @@ -293,12 +291,11 @@ Label8="Address:" Label9="Home Phone:" Label10="Work Phone:" Label11="Mobile Phone:" - ``` You can compile this .txt file into a .resources file by issuing the following command: - **resgen PatientForm.txt** +`resgen PatientForm.txt` The following example enumerates the resources in `PatientForm.resources` and displays the name and value of each. @@ -514,15 +511,12 @@ Label11="Mobile Phone:" 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. > [!IMPORTANT] -> The class includes two methods that return enumerators. The method returns an interface object and is the recommended method to call when enumerating resources. - - +> The class includes two methods that return enumerators. The method returns an interface object and is the recommended method to call when enumerating resources. ## Examples The example in this section uses the following .txt file named `PatientForm.txt` to define the resources used by an application. -``` - +```txt Title="Top Pet Animal Clinic" Label1="Patient Number:" Label2="Pet Name:" @@ -535,12 +529,11 @@ Label8="Address:" Label9="Home Phone:" Label10="Work Phone:" Label11="Mobile Phone:" - ``` You can compile the .txt file into a .resources file by issuing the following command: - **resgen PatientForm.txt** +`resgen PatientForm.txt` The following example enumerates the resources in `PatientForm.resources` and displays the name and value of each. From b08b54e4397f922923995c3eff13099fa5252be5 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 23 Apr 2025 19:14:19 -0700 Subject: [PATCH 12/16] add language slugs (#11226) --- .../FeatureSwitchDefinitionAttribute.xml | 1 + .../EventSource.xml | 9 ++---- xml/System.Diagnostics/Debug.xml | 12 ++----- xml/System.Diagnostics/EventLog.xml | 32 +++++++++---------- xml/System.Diagnostics/EventLogInstaller.xml | 13 ++++---- xml/System.Diagnostics/ProcessStartInfo.xml | 2 ++ .../XmlWriterTraceListener.xml | 12 +++---- 7 files changed, 37 insertions(+), 44 deletions(-) diff --git a/xml/System.Diagnostics.CodeAnalysis/FeatureSwitchDefinitionAttribute.xml b/xml/System.Diagnostics.CodeAnalysis/FeatureSwitchDefinitionAttribute.xml index 389f2e15be6..d59eeec740d 100644 --- a/xml/System.Diagnostics.CodeAnalysis/FeatureSwitchDefinitionAttribute.xml +++ b/xml/System.Diagnostics.CodeAnalysis/FeatureSwitchDefinitionAttribute.xml @@ -58,6 +58,7 @@ When the app is trimmed with the following feature settings in the project file, ``` + ]]> diff --git a/xml/System.Diagnostics.Tracing/EventSource.xml b/xml/System.Diagnostics.Tracing/EventSource.xml index 2d532965a91..b31d562844c 100644 --- a/xml/System.Diagnostics.Tracing/EventSource.xml +++ b/xml/System.Diagnostics.Tracing/EventSource.xml @@ -3088,9 +3088,9 @@ public void Info1(string arg1) ## Remarks `eventid` should be greater than 0 or less than 65535 or errors can occur in the operation. If errors do occur, you can get more information about the source of the error by checking the output stream of the debugger, if you have a debugger attached to the process firing events. You can also look for errors reported in the ETW event stream, if you have an ETW listener on the event source where the error occurs. - When you implement a method that is identified as an ETW event in an -derived class. You must call the base class method passing the and the same arguments as the implemented method similar to the following example. + When you implement a method that's identified as an ETW event in an -derived class, you must call the base class method passing the and the same arguments as the implemented method similar to the following example. -``` +```csharp [Event(2, Level = EventLevel.Informational)] public void Info1(Int64 arg1, string arg2) { @@ -3697,13 +3697,11 @@ public void Info1(string arg1) The following example shows how to add a overload that accepts four arguments. An example would be if you have a logging event that logs a string and 3 integers. ```csharp - [Event(1)] public void LogTime(string tag, int hour, int minute, int second) { WriteEvent(1, tag, hour, minute, second); } - ``` You could do this without calling , but it would be slower than it needs to be. That is because it uses arrays and reflection to figure out what to do. If you log these at a high rate (> 1000 / sec), it can be worth making a fast helper, as shown in the following example. The method shadows the existing . Thus the original caller code (LogTime) does not actually change, but the C# compiler will use the more specialized version which will be faster. @@ -3734,10 +3732,9 @@ class AnotherEventSource : EventSource { } } } - ``` - These are the expected sizes and data encodings for standard serializable types: +These are the expected sizes and data encodings for standard serializable types: ```csharp // bool arg diff --git a/xml/System.Diagnostics/Debug.xml b/xml/System.Diagnostics/Debug.xml index a73921e7764..873df186dc7 100644 --- a/xml/System.Diagnostics/Debug.xml +++ b/xml/System.Diagnostics/Debug.xml @@ -1264,13 +1264,11 @@ The following example sets the indent level and emits debugging messages. This example produces the following output: -``` - +```txt List of errors: Error 1: File not found Error 2: Directory not found End of list of errors - ``` ]]> @@ -1338,13 +1336,11 @@ The following example sets the indent level and emits debugging messages. This example produces the following output: -``` - +```txt List of errors: Error 1: File not found Error 2: Directory not found End of list of errors - ``` ]]> @@ -1713,13 +1709,11 @@ The following example sets the indent level and emits debugging messages. This example produces the following output: -``` - +```txt List of errors: Error 1: File not found Error 2: Directory not found End of list of errors - ``` ]]> diff --git a/xml/System.Diagnostics/EventLog.xml b/xml/System.Diagnostics/EventLog.xml index 675f0ee02b5..6fc19e04de7 100644 --- a/xml/System.Diagnostics/EventLog.xml +++ b/xml/System.Diagnostics/EventLog.xml @@ -696,7 +696,7 @@ The example uses the following message text file, built into the resource library EventLogMsgs.dll. A message text file is the source from which the message resource file is created. The message text file defines the resource identifiers and text for the category, event message, and parameter insertion strings. Specifically, resource identifier 5001 is defined for the localized name of the event log. -``` +```txt ; // EventLogMsgs.mc ; // ******************************************************** @@ -2513,15 +2513,15 @@ SVC_UPDATE.EXE This property is deprecated. To be added. - [!IMPORTANT] > Support for the property was removed in Windows Vista and later operating systems. Setting this value can cause the Event Log to never overwrite events, and to drop all events to the channel once it is full. - -## Examples - The following example enumerates the event logs defined on the local computer, and displays configuration details for each event log. + +## Examples + The following example enumerates the event logs defined on the local computer, and displays configuration details for each event log. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/EventLogProperties/CPP/source.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Diagnostics/EventLog/GetEventLogs/source1.cs" id="Snippet2"::: @@ -2587,11 +2587,11 @@ SVC_UPDATE.EXE The method configures the overflow behavior of an event log. instance. After calling this method for the event log specified by the property, the and property values reflect the newly configured overflow behavior. > [!NOTE] -> This property represents a configuration setting for the event log represented by this instance. When the event log reaches its maximum size, this property specifies how the operating system handles new entries written by all event sources registered for the event log. - - Set the `action` parameter to to indicate that a new entry overwrites the oldest entry when the reaches its maximum size. If the `action` parameter is set to , the `retentionDays` parameter value is ignored. +> This property represents a configuration setting for the event log represented by this instance. When the event log reaches its maximum size, this property specifies how the operating system handles new entries written by all event sources registered for the event log. - Set the `action` parameter to to discard new events when the maximum log size is reached. If the `action` parameter is set to , the `retentionDays` parameter value is ignored. + Set the `action` parameter to to indicate that a new entry overwrites the oldest entry when the reaches its maximum size. If the `action` parameter is set to , the `retentionDays` parameter value is ignored. + + Set the `action` parameter to to discard new events when the maximum log size is reached. If the `action` parameter is set to , the `retentionDays` parameter value is ignored. > [!WARNING] > Never set the `action` parameter to . This value is deprecated and might cause the log to behave as if the `DoNotOverwrite` parameter was passed instead. @@ -2756,7 +2756,7 @@ SVC_UPDATE.EXE The example uses the following message text file, built into the resource library EventLogMsgs.dll. A message text file is the source from which the message resource file is created. The message text file defines the resource identifiers and text for the category, event message, and parameter insertion strings. Specifically, resource identifier 5001 is defined for the localized name of the event log. -``` +```txt ; // EventLogMsgs.mc ; // ******************************************************** @@ -4446,7 +4446,7 @@ SVC_UPDATE.EXE The example uses the following message text file, built into the resource library EventLogMsgs.dll. A message text file is the source from which the message resource file is created. The message text file defines the resource identifiers and text for the category, event message, and parameter insertion strings. -``` +```txt ; // EventLogMsgs.mc ; // ******************************************************** @@ -4679,7 +4679,7 @@ SVC_UPDATE.EXE The example uses the following message text file, built into the resource library EventLogMsgs.dll. A message text file is the source from which the message resource file is created. The message text file defines the resource identifiers and text for the category, event message, and parameter insertion strings. -``` +```txt ; // EventLogMsgs.mc ; // ******************************************************** @@ -4898,7 +4898,7 @@ SVC_UPDATE.EXE The example uses the following message text file, built into the resource library EventLogMsgs.dll. A message text file is the source from which the message resource file is created. The message text file defines the resource identifiers and text for the category, event message, and parameter insertion strings. -``` +```txt ; // EventLogMsgs.mc ; // ******************************************************** @@ -5117,7 +5117,7 @@ SVC_UPDATE.EXE The example uses the following message text file, built into the resource library EventLogMsgs.dll. A message text file is the source from which the message resource file is created. The message text file defines the resource identifiers and text for the category, event message, and parameter insertion strings. -``` +```txt ; // EventLogMsgs.mc ; // ******************************************************** diff --git a/xml/System.Diagnostics/EventLogInstaller.xml b/xml/System.Diagnostics/EventLogInstaller.xml index 0127fb3f5d0..ef7a3034deb 100644 --- a/xml/System.Diagnostics/EventLogInstaller.xml +++ b/xml/System.Diagnostics/EventLogInstaller.xml @@ -131,7 +131,7 @@ The code example uses the following message text file, built into the resource library EventLogMsgs.dll. A message text file is the source from which the message resource file is created. The message text file defines the resource identifiers and text for the category, event message, and parameter insertion strings. -``` +```txt ; // EventLogMsgs.mc ; // ******************************************************** @@ -311,7 +311,7 @@ SVC_UPDATE.EXE The code example uses the following message text file, built into the resource library EventLogMsgs.dll. A message text file is the source from which the message resource file is created. The message text file defines the resource identifiers and text for the category, event message, and parameter insertion strings. -``` +```txt ; // EventLogMsgs.mc ; // ******************************************************** @@ -670,7 +670,7 @@ SVC_UPDATE.EXE The code example uses the following message text file, built into the resource library EventLogMsgs.dll. A message text file is the source from which the message resource file is created. The message text file defines the resource identifiers and text for the category, event message, and parameter insertion strings. -``` +```txt ; // EventLogMsgs.mc ; // ******************************************************** @@ -835,8 +835,7 @@ SVC_UPDATE.EXE For example, the following section of a message text file defines a string with a parameter placeholder: -``` - +```txt MessageId = 1501 Severity = Success Facility = Application @@ -848,7 +847,7 @@ Component %%6050 is starting. Within the parameter resource file, the insertion string must be defined with the resource identifier that corresponds to the placeholder, as shown below: -``` +```txt MessageId = 6050 Severity = Success Facility = Application @@ -875,7 +874,7 @@ TRIGGER.EXE The code example uses the following message text file, built into the resource library EventLogMsgs.dll. A message text file is the source from which the message resource file is created. The message text file defines the resource identifiers and text for the category, event message, and parameter insertion strings. Specifically, the message defined for resource identifier 1004 uses a placeholder for a parameter string defined for resource identifier 5002. -``` +```txt ; // EventLogMsgs.mc ; // ******************************************************** diff --git a/xml/System.Diagnostics/ProcessStartInfo.xml b/xml/System.Diagnostics/ProcessStartInfo.xml index 4c54e890b4c..48ab5aeb0a3 100644 --- a/xml/System.Diagnostics/ProcessStartInfo.xml +++ b/xml/System.Diagnostics/ProcessStartInfo.xml @@ -338,6 +338,7 @@ var info = new System.Diagnostics.ProcessStartInfo("cmd.exe") Arguments = "/c dir \"C:\\Program Files\\dotnet\"" }; ``` + ```vb Dim info As New System.Diagnostics.ProcessStartInfo("cmd.exe") info.ArgumentList.Add("/c") @@ -347,6 +348,7 @@ info.ArgumentList.Add("C:\Program Files\dotnet") ' The corresponding assignment to the Arguments property is: info.Arguments = "/c dir ""C:\Program Files\dotnet""" ``` + ]]> diff --git a/xml/System.Diagnostics/XmlWriterTraceListener.xml b/xml/System.Diagnostics/XmlWriterTraceListener.xml index 9468d4ab4a0..091a171c261 100644 --- a/xml/System.Diagnostics/XmlWriterTraceListener.xml +++ b/xml/System.Diagnostics/XmlWriterTraceListener.xml @@ -300,9 +300,9 @@ You can create an in your code. ## Remarks This constructor initializes the property to the `name` parameter value or to an empty string ("") if the `name` parameter is `null`. The name can be used as an index into the collection to programmatically change the properties for the listener. For example, the following code sets the property for an instance of whose property is "xmlListener". -``` +```csharp ((XmlWriterTraceListener)Trace.Listeners["xmlListener"]).TraceOutputOptions = - TraceOptions.Timestamp + TraceOptions.Timestamp; ``` ]]> @@ -357,9 +357,9 @@ You can create an in your code. ## Remarks This constructor initializes the property to the `name` parameter value or to an empty string ("") if the `name` parameter is `null`. The name can be used as an index into the collection to programmatically change the properties for the listener. For example, the following code sets the property for an instance of whose property is "xmlListener". -``` +```csharp ((XmlWriterTraceListener)Trace.Listeners["xmlListener"]).TraceOutputOptions = - TraceOptions.Timestamp. + TraceOptions.Timestamp; ``` ]]> @@ -412,9 +412,9 @@ You can create an in your code. The property is set to the `name` parameter value or to an empty string ("") if the `name` parameter is `null`. The name can be used as an index into the collection to programmatically change the properties for the listener. For example, the following code sets the property for an instance of whose property is "xmlListener". -``` +```csharp ((XmlWriterTraceListener)Trace.Listeners["xmlListener"]).TraceOutputOptions = - TraceOptions.Timestamp. + TraceOptions.Timestamp; ``` ]]> From 9a06c053dd74edbf19c68f6585a6be0dac1aabbd Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 23 Apr 2025 20:26:38 -0700 Subject: [PATCH 13/16] Add language slugs (System.Xml) (#11218) --- xml/System.Xml.Linq/XAttribute.xml | 78 +++++------ xml/System.Xml.Linq/XDocument.xml | 20 +-- xml/System.Xml.Linq/XElement.xml | 126 +++++++++-------- xml/System.Xml.Linq/XName.xml | 18 +-- xml/System.Xml.Linq/XNamespace.xml | 24 ++-- .../XProcessingInstruction.xml | 8 +- xml/System.Xml.Linq/XStreamingElement.xml | 14 +- xml/System.Xml.Schema/XmlSchemaCollection.xml | 2 +- xml/System.Xml.Schema/XmlSchemaSet.xml | 6 +- .../XmlAttributeEventArgs.xml | 8 +- .../XmlAttributes.xml | 2 +- .../XmlSerializer.xml | 6 +- xml/System.Xml.XPath/XPathNavigator.xml | 127 ------------------ xml/System.Xml.Xsl/XslTransform.xml | 32 ++--- xml/System.Xml/XmlDictionaryWriter.xml | 1 - xml/System.Xml/XmlDocument.xml | 26 ++-- xml/System.Xml/XmlNamespaceManager.xml | 4 +- xml/System.Xml/XmlNode.xml | 12 +- xml/System.Xml/XmlReader.xml | 7 +- xml/System.Xml/XmlReaderSettings.xml | 4 +- xml/System.Xml/XmlTextReader.xml | 7 +- xml/System.Xml/XmlWriter.xml | 4 +- 22 files changed, 194 insertions(+), 342 deletions(-) diff --git a/xml/System.Xml.Linq/XAttribute.xml b/xml/System.Xml.Linq/XAttribute.xml index c407262531e..ecb196989a1 100644 --- a/xml/System.Xml.Linq/XAttribute.xml +++ b/xml/System.Xml.Linq/XAttribute.xml @@ -177,8 +177,7 @@ End If This example produces the following output: -``` - +```txt Creating a deep copy created a new attribute from the original. ``` @@ -311,8 +310,7 @@ Console.WriteLine(root) This example produces the following output: -``` - +```xml ``` @@ -459,7 +457,7 @@ Next This example produces the following output: -``` +```txt {http://www.w3.org/2000/xmlns/}aw is a namespace declaration {http://www.adventure-works.com}Att is not a namespace declaration ``` @@ -568,12 +566,11 @@ Dim NewRoot As XElement = _ For Each att As XAttribute In NewRoot.Attributes() Console.WriteLine("{0}={1}", att.Name, att.Value) Next - ``` This example produces the following output: -``` +```txt {http://www.w3.org/2000/xmlns/}aw=http://www.adventure-works.com {http://www.adventure-works.com}Att=content Att2=different content @@ -675,7 +672,7 @@ Loop While (Not (att Is Nothing)) This example produces the following output: -``` +```txt Att1="1" Att2="2" Att3="3" @@ -755,8 +752,7 @@ Console.WriteLine(att.NodeType.ToString) This example produces the following output: -``` - +```txt Attribute ``` @@ -841,7 +837,7 @@ Console.WriteLine("(bool)BoolValue={0}", bv) This example produces the following output: -``` +```txt (bool)BoolValue=True ``` @@ -960,7 +956,7 @@ Console.WriteLine("OrderDate={0:d}", orderDate) This example produces the following output: -``` +```txt dt=10/6/2006 12:30:00 PM ----- @@ -1058,7 +1054,7 @@ Console.WriteLine("dt={0}", dt) This example produces the following output: -``` +```txt dt=10/6/2006 12:30:00 PM -07:00 ``` @@ -1140,7 +1136,7 @@ Console.WriteLine("value={0}", value) This example produces the following output: -``` +```txt value=79228162514264337593543950335 ``` @@ -1221,7 +1217,7 @@ Console.WriteLine("value={0}", value) This example produces the following output: -``` +```txt value=1.79769313486231E+308 ``` @@ -1302,7 +1298,7 @@ Console.WriteLine("value={0}", value) This example produces the following output: -``` +```txt value=3c1cc55b-baff-4b7a-9d17-077af3aa5730 ``` @@ -1383,7 +1379,7 @@ Console.WriteLine("value={0}", value) This example produces the following output: -``` +```txt value=2147483647 ``` @@ -1464,7 +1460,7 @@ Console.WriteLine("value={0}", value) This example produces the following output: -``` +```txt value=9223372036854775807 ``` @@ -1556,7 +1552,7 @@ Console.WriteLine("Nullable boolean: BoolValue2={0}", bool2) This example produces the following output: -``` +```txt Nullable boolean: BoolValue1=True Nullable boolean: BoolValue2=False ``` @@ -1647,7 +1643,7 @@ Console.WriteLine("Nullable DateTime: value={0}", IIf(value.HasValue, value.ToSt This example produces the following output: -``` +```txt Nullable DateTime: value=10/6/2006 12:30:00 PM ``` @@ -1735,7 +1731,7 @@ Console.WriteLine("Nullable DateTimeOffset: value={0}", IIf(value.HasValue, valu This example produces the following output: -``` +```txt Nullable DateTimeOffset: value=10/6/2006 12:30:00 PM -07:00 ``` @@ -1814,7 +1810,7 @@ Console.WriteLine("Nullable decimal: value={0}", IIf(value.HasValue, value.ToStr This example produces the following output: -``` +```txt Nullable decimal: value=79228162514264337593543950335 ``` @@ -1895,7 +1891,7 @@ Console.WriteLine("Nullable double: value={0}", IIf(value.HasValue, value.ToStri This example produces the following output: -``` +```txt Nullable double: value=1.79769313486231E+308 ``` @@ -1976,7 +1972,7 @@ Console.WriteLine("Nullable Guid: value={0}", IIf(value.HasValue, value.ToString This example produces the following output: -``` +```txt Nullable Guid: value=3c1cc55b-baff-4b7a-9d17-077af3aa5730 ``` @@ -2057,7 +2053,7 @@ Console.WriteLine("Nullable int: value={0}", IIf(value.HasValue, value.ToString( This example produces the following output: -``` +```txt Nullable int: value=2147483647 ``` @@ -2137,7 +2133,7 @@ Console.WriteLine("Nullable long: value={0}", IIf(value.HasValue, value.ToString This example produces the following output: -``` +```txt Nullable long: value=9223372036854775807 ``` @@ -2218,7 +2214,7 @@ Console.WriteLine("Nullable Single: value={0}", IIf(value.HasValue, value.ToStri This example produces the following output: -``` +```txt Nullable Single: value=3.402823E+38 ``` @@ -2306,7 +2302,7 @@ Console.WriteLine("Nullable TimeSpan: value={0}", IIf(value.HasValue, value.ToSt This example produces the following output: -``` +```txt Nullable TimeSpan: value=01:05:30 ``` @@ -2387,7 +2383,7 @@ Console.WriteLine("Nullable uint: value={0}", IIf(value.HasValue, value.ToString This example produces the following output: -``` +```txt Nullable uint: value=4294967295 ``` @@ -2468,7 +2464,7 @@ Console.WriteLine("Nullable ulong: value={0}", IIf(value.HasValue, value.ToStrin This example produces the following output: -``` +```txt Nullable ulong: value=9223372036854775807 ``` @@ -2548,7 +2544,7 @@ Console.WriteLine("value={0}", value) This example produces the following output: -``` +```txt value=3.402823E+38 ``` @@ -2632,7 +2628,7 @@ Console.WriteLine("(string)att={0}", str) This example produces the following output: -``` +```txt (string)att=attribute content ``` @@ -2718,7 +2714,7 @@ Console.WriteLine("value={0}", value) This example produces the following output: -``` +```txt value=01:05:30 ``` @@ -2799,7 +2795,7 @@ Console.WriteLine("value={0}", value) This example produces the following output: -``` +```txt value=4294967295 ``` @@ -2880,7 +2876,7 @@ Console.WriteLine("value={0}", value) This example produces the following output: -``` +```txt value=1844674407370955161 ``` @@ -2979,7 +2975,7 @@ Loop While (Not (att Is Nothing)) This example produces the following output: -``` +```txt Att4="4" Att3="3" Att2="2" @@ -3066,7 +3062,7 @@ Console.WriteLine(root) This example produces the following output: -``` +```xml ``` @@ -3153,7 +3149,7 @@ Console.WriteLine(root) This example produces the following output: -``` +```xml ``` @@ -3240,7 +3236,7 @@ Console.WriteLine(att.ToString()) This example produces the following output: -``` +```txt Att2="content2" ``` @@ -3331,7 +3327,7 @@ Console.WriteLine(root.@Att) This example produces the following output: -``` +```txt content new text ``` @@ -3463,7 +3459,7 @@ Console.WriteLine("v4:{0}", IIf(v4.HasValue, v4, "attribute does not exist")) This example produces the following output: -``` +```txt c1:attribute 1 content c2:2 c3:attribute does not exist diff --git a/xml/System.Xml.Linq/XDocument.xml b/xml/System.Xml.Linq/XDocument.xml index c59310a6009..dc4acbd0b0d 100644 --- a/xml/System.Xml.Linq/XDocument.xml +++ b/xml/System.Xml.Linq/XDocument.xml @@ -731,7 +731,7 @@ Console.WriteLine(doc.Declaration) This example produces the following output: -``` +```xml ``` @@ -1163,7 +1163,7 @@ Console.WriteLine(doc) This example produces the following output: -``` +```xml
Ellen Adams @@ -1515,7 +1515,7 @@ Console.WriteLine("Count of white space nodes (preserving whitespace): {0}", whi This example produces the following output: -``` +```txt Count of white space nodes (not preserving whitespace): 0 Count of white space nodes (preserving whitespace): 3 ``` @@ -1628,7 +1628,7 @@ Console.WriteLine("nodes if preserving whitespace: {0}", doc2.DescendantNodes(). This example produces the following output: -``` +```txt nodes if not preserving whitespace: 48 nodes if preserving whitespace: 82 ``` @@ -1779,7 +1779,7 @@ End Using This example produces the following output: -``` +```txt Element Name Line Position ------------ ---- -------- Root 1 2 @@ -2020,7 +2020,7 @@ Console.WriteLine("{0}", xmlTree.NodeType) This example produces the following output: -``` +```txt Document ``` @@ -2295,7 +2295,7 @@ Console.WriteLine("nodes when not preserving whitespace: {0}", doc2.DescendantNo This example produces the following output: -``` +```txt nodes when preserving whitespace: 8 nodes when not preserving whitespace: 4 ``` @@ -2409,7 +2409,7 @@ Console.WriteLine(doc.Root.Name.ToString()) This example produces the following output: -``` +```txt Pubs ``` @@ -2933,7 +2933,7 @@ End Using This example produces the following output: -``` +```txt content @@ -3032,7 +3032,7 @@ Console.WriteLine(File.ReadAllText("Root2.xml")) This example produces the following output: -``` +```xml content diff --git a/xml/System.Xml.Linq/XElement.xml b/xml/System.Xml.Linq/XElement.xml index d2cad372235..f3ab52dccb1 100644 --- a/xml/System.Xml.Linq/XElement.xml +++ b/xml/System.Xml.Linq/XElement.xml @@ -383,7 +383,7 @@ Console.WriteLine("xmlTree = treeClone: {0}", XNode.DeepEquals(xmlTree, treeClon This example produces the following output: -``` +```txt xmlTree = treeClone: True xmlTree = treeClone: False ``` @@ -578,7 +578,7 @@ Console.WriteLine(xse) This example produces the following output: -``` +```xml 2 3 @@ -1365,7 +1365,7 @@ Next This example produces the following output: -``` +```txt GrandChild Child Root @@ -1470,7 +1470,7 @@ Next This example produces the following output: -``` +```txt Child ``` @@ -1554,7 +1554,7 @@ Console.WriteLine(att) This example produces the following output: -``` +```txt Att="attribute content" ``` @@ -1585,7 +1585,7 @@ End Module This example produces the following output: -``` +```txt aw:Att="attribute content" ``` @@ -1698,7 +1698,7 @@ Next This example produces the following output: -``` +```txt Att1="content1" Att2="content2" ``` @@ -1739,7 +1739,7 @@ End Module This example produces the following output: -``` +```txt aw:Att1="content1" aw:Att2="content2" xmlns:aw="http://www.adventure-works.com" @@ -1837,7 +1837,7 @@ Next This example produces the following output: -``` +```txt Att1="content1" ``` @@ -1873,7 +1873,7 @@ End Module This example produces the following output: -``` +```txt aw:Att1="content1" ``` @@ -1976,7 +1976,7 @@ Next This example produces the following output: -``` +```txt Root Child Some text @@ -2093,7 +2093,7 @@ Next This example produces the following output: -``` +```txt Root Child GrandChild @@ -2196,7 +2196,7 @@ Next This example produces the following output: -``` +```txt Child ``` @@ -2328,7 +2328,7 @@ Console.WriteLine(xmlTree.FirstAttribute) This example produces the following output: -``` +```txt Att1="1" ``` @@ -2413,7 +2413,7 @@ End Module This example produces the following output: -``` +```txt Default namespace: http://www.adventure-works.com ``` @@ -2499,7 +2499,7 @@ End Module This example produces the following output: -``` +```txt Namespace: http://www.adventure-works.com ``` @@ -2585,7 +2585,7 @@ End Module This example produces the following output: -``` +```txt Prefix: aw ``` @@ -2659,7 +2659,7 @@ Console.WriteLine(xmlTree2.HasAttributes) This example produces the following output: -``` +```txt True False ``` @@ -2737,7 +2737,7 @@ Console.WriteLine(xmlTree2.HasElements) This example produces the following output: -``` +```txt True False ``` @@ -2836,7 +2836,7 @@ Console.WriteLine(el3.IsEmpty) This example produces the following output: -``` +```txt True @@ -2932,7 +2932,7 @@ Console.WriteLine(xmlTree.LastAttribute) This example produces the following output: -``` +```txt Att3="3" ``` @@ -3211,7 +3211,7 @@ Console.WriteLine(xmlTree2.Name) This example produces the following output: -``` +```txt Root ``` @@ -3521,7 +3521,7 @@ Console.WriteLine("Count of white space nodes (preserving whitespace): {0}", whi This example produces the following output: -``` +```txt Count of white space nodes (not preserving whitespace): 0 Count of white space nodes (preserving whitespace): 3 ``` @@ -3580,7 +3580,7 @@ Next This example produces the following output: -``` +```txt Element Name Line Position ------------ ---- -------- Root 1 2 @@ -3721,7 +3721,7 @@ Console.WriteLine("Count of white space nodes (preserving whitespace): {0}", whi This example produces the following output: -``` +```txt Count of white space nodes (not preserving whitespace): 0 Count of white space nodes (preserving whitespace): 3 @@ -3775,7 +3775,7 @@ Next This example produces the following output: -``` +```txt BaseUri: PurchaseOrder.xml Element Name Line Position @@ -3951,7 +3951,7 @@ End Using This example produces the following output: -``` +```txt Element Name Line Position ------------ ---- -------- Root 1 2 @@ -4209,7 +4209,7 @@ End Module This example produces the following output: -``` +```txt Root {http://www.adventure-works.com}Root http://www.adventure-works.com @@ -4286,7 +4286,7 @@ Console.WriteLine() This example produces the following output: -``` +```txt Element ``` @@ -4378,7 +4378,7 @@ Console.WriteLine("(bool)BoolValue2={0}", bool2) This example produces the following output: -``` +```txt (bool)BoolValue1=True (bool)BoolValue2=False ``` @@ -4490,7 +4490,7 @@ Console.WriteLine("orderDate={0:d}", orderDate) This example produces the following output: -``` +```txt 2006-10-06T12:30:00 dt=10/6/2006 12:30:00 PM ----- @@ -4588,7 +4588,7 @@ Console.WriteLine("dt={0}", dt) This example produces the following output: -``` +```txt 2006-10-06T12:30:00-07:00 @@ -4669,12 +4669,11 @@ Console.WriteLine("value={0}", value); Dim root As XElement = 79228162514264337593543950335 Dim value As Decimal = CDec(root) Console.WriteLine("value={0}", value) - ``` This example produces the following output: -``` +```txt value=79228162514264337593543950335 ``` @@ -4755,7 +4754,7 @@ Console.WriteLine("value={0}", value) This example produces the following output: -``` +```txt value=1.79769313486231E+308 ``` @@ -4837,7 +4836,7 @@ Console.WriteLine("value={0}", value) This example produces the following output: -``` +```txt value=3c1cc55b-baff-4b7a-9d17-077af3aa5730 ``` @@ -4919,7 +4918,7 @@ Console.WriteLine("value={0}", value) This example produces the following output: -``` +```txt value=2147483647 ``` @@ -4999,7 +4998,7 @@ Console.WriteLine("value={0}", value) This example produces the following output: -``` +```txt value=9223372036854775807 ``` @@ -5096,7 +5095,7 @@ Console.WriteLine("Nullable Boolean: value2={0}", IIf(value2.HasValue, value2.To This example produces the following output: -``` +```txt Nullable Boolean: value1=True Nullable Boolean: value2=False ``` @@ -5189,7 +5188,7 @@ Console.WriteLine("Nullable DateTime: value={0}", IIf(value.HasValue, value.ToSt This example produces the following output: -``` +```txt Nullable DateTime: value=10/6/2006 12:30:00 PM ``` @@ -5281,7 +5280,7 @@ Console.WriteLine("dt={0}", dt) This example produces the following output: -``` +```txt 2006-10-06T12:30:00-07:00 @@ -5369,7 +5368,7 @@ Console.WriteLine("Nullable decimal: value={0}", IIf(value.HasValue, value.ToStr This example produces the following output: -``` +```txt Nullable decimal: value=79228162514264337593543950335 ``` @@ -5455,7 +5454,7 @@ Console.WriteLine("Nullable double: value={0}", IIf(value.HasValue, value.ToStri This example produces the following output: -``` +```txt Nullable double: value=1.79769313486231E+308 ``` @@ -5540,7 +5539,7 @@ Console.WriteLine("Nullable Guid: value={0}", IIf(value.HasValue, value.ToString This example produces the following output: -``` +```txt Nullable Guid: value=3c1cc55b-baff-4b7a-9d17-077af3aa5730 ``` @@ -5621,12 +5620,11 @@ Dim root As XElement = _ Dim value As Nullable(Of Integer) = CType(root.Element("Value"), Nullable(Of Integer)) Console.WriteLine("Nullable integer: value={0}", IIf(value.HasValue, value.ToString(), "null")) - ``` This example produces the following output: -``` +```txt Nullable integer: value=2147483647 ``` @@ -5711,7 +5709,7 @@ Console.WriteLine("Nullable ulong: value={0}", IIf(value.HasValue, value.ToStrin This example produces the following output: -``` +```txt Nullable ulong: value=9223372036854775807 ``` @@ -5796,7 +5794,7 @@ Console.WriteLine("Nullable Single: value={0}", IIf(value.HasValue, value.ToStri This example produces the following output: -``` +```txt Nullable Single: value=3.402823E+38 ``` @@ -5886,7 +5884,7 @@ Console.WriteLine("Nullable TimeSpan: value={0}", IIf(value.HasValue, value.ToSt This example produces the following output: -``` +```txt Nullable TimeSpan: value=01:05:30 ``` @@ -5971,7 +5969,7 @@ Console.WriteLine("Nullable uint: value={0}", IIf(value.HasValue, value.ToString This example produces the following output: -``` +```txt Nullable uint: value=4294967295 ``` @@ -6057,7 +6055,7 @@ Console.WriteLine("Nullable ulong: value={0}", IIf(value.HasValue, value.ToStrin This example produces the following output: -``` +```txt Nullable ulong: value=9223372036854775807 ``` @@ -6136,7 +6134,7 @@ Console.WriteLine("value={0}", value) This example produces the following output: -``` +```txt value=3.402823E+38 ``` @@ -6220,7 +6218,7 @@ Console.WriteLine("(string)root={0}", root.Value) This example produces the following output: -``` +```txt (string)root=abc def ghi ``` @@ -6303,7 +6301,7 @@ Console.WriteLine("value={0}", value) This example produces the following output: -``` +```txt value=01:05:30 ``` @@ -6383,7 +6381,7 @@ Console.WriteLine("value={0}", value) This example produces the following output: -``` +```txt value=4294967295 ``` @@ -6463,7 +6461,7 @@ Console.WriteLine("value={0}", value) This example produces the following output: -``` +```txt value=18446744073709551615 ``` @@ -6691,7 +6689,7 @@ Console.WriteLine("Count of white space nodes (preserving whitespace): {0}", whi This example produces the following output: -``` +```txt Count of white space nodes (not preserving whitespace): 0 Count of white space nodes (preserving whitespace): 3 ``` @@ -6749,7 +6747,7 @@ Next This example produces the following output: -``` +```txt Element Name Line Position ------------ ---- -------- Root 1 2 @@ -7010,7 +7008,7 @@ Console.WriteLine(xmlTree) This example produces the following output: -``` +```txt 1 2 @@ -8089,7 +8087,7 @@ End Using This example produces the following output: -``` +```txt Text ===== @@ -8192,7 +8190,7 @@ Console.WriteLine(str) This example produces the following output: -``` +```txt Text ===== @@ -8448,7 +8446,7 @@ Console.WriteLine(root) This example produces the following output: -``` +```txt @@ -8575,7 +8573,7 @@ Console.WriteLine(root) This example produces the following output: -``` +```txt 1 2 @@ -8921,7 +8919,7 @@ Console.WriteLine("{0}", el.Value) This example produces the following output: -``` +```txt This is mixed content ``` diff --git a/xml/System.Xml.Linq/XName.xml b/xml/System.Xml.Linq/XName.xml index fd26bf67cbc..fad7699187a 100644 --- a/xml/System.Xml.Linq/XName.xml +++ b/xml/System.Xml.Linq/XName.xml @@ -255,7 +255,7 @@ End Module This example produces the following output: -``` +```txt content content ``` @@ -355,7 +355,7 @@ End Module This example produces the following output: -``` +```txt content content ``` @@ -495,7 +495,7 @@ End Module This example produces the following output: -``` +```txt {http://www.adventure-works.com}Root Root http://www.adventure-works.com @@ -587,7 +587,7 @@ End Module This example produces the following output: -``` +```txt {http://www.adventure-works.com}Root Root http://www.adventure-works.com @@ -667,7 +667,7 @@ End Module This example produces the following output: -``` +```txt http://www.adventure-works.com ``` @@ -758,7 +758,7 @@ Console.WriteLine(root.Name = "Root") This example produces the following output: -``` +```txt True True True @@ -857,7 +857,7 @@ End Module This example produces the following output: -``` +```txt content content ``` @@ -949,7 +949,7 @@ End Module This example produces the following output: -``` +```txt False False ``` @@ -1133,7 +1133,7 @@ End Module This example produces the following output: -``` +```txt {http://www.adventure-works.com}Root Root http://www.adventure-works.com diff --git a/xml/System.Xml.Linq/XNamespace.xml b/xml/System.Xml.Linq/XNamespace.xml index 25112946bca..754ca325b46 100644 --- a/xml/System.Xml.Linq/XNamespace.xml +++ b/xml/System.Xml.Linq/XNamespace.xml @@ -134,7 +134,7 @@ End Module This example produces the following output: -``` +```txt True ``` @@ -223,7 +223,7 @@ End Module This example produces the following output: -``` +```txt http://www.adventure-works.com http://www.adventure-works.com ``` @@ -358,7 +358,7 @@ End Module This example produces the following output: -``` +```txt {http://www.adventure-works.com}Root ``` @@ -440,7 +440,7 @@ End Module This example produces the following output: -``` +```txt http://www.adventure-works.com ``` @@ -559,7 +559,7 @@ End Module This example produces the following output: -``` +```txt Root element is in no namespace ChildInNamespace element is in a namespace ChildInNoNamespace element is in no namespace @@ -659,7 +659,7 @@ End Module This example produces the following output: -``` +```xml @@ -743,7 +743,7 @@ End Module This example produces the following output: -``` +```txt True ``` @@ -824,7 +824,7 @@ End Module This example produces the following output: -``` +```txt http://www.adventure-works.com ``` @@ -906,7 +906,7 @@ End Module This example produces the following output: -``` +```txt False ``` @@ -979,7 +979,7 @@ End Module This example produces the following output: -``` +```txt http://www.adventure-works.com ``` @@ -1056,7 +1056,7 @@ Console.WriteLine(root) This example produces the following output: -``` +```xml content @@ -1151,7 +1151,7 @@ End Module This example produces the following output: -``` +```xml content diff --git a/xml/System.Xml.Linq/XProcessingInstruction.xml b/xml/System.Xml.Linq/XProcessingInstruction.xml index 285353713a6..4b5ec7bff8a 100644 --- a/xml/System.Xml.Linq/XProcessingInstruction.xml +++ b/xml/System.Xml.Linq/XProcessingInstruction.xml @@ -185,7 +185,7 @@ Console.WriteLine(pi) This example produces the following output: -``` +```xml ``` @@ -267,7 +267,7 @@ Console.WriteLine(pi.Data) This example produces the following output: -``` +```txt type='text/xsl' href='hello.xsl' type='text/xsl' href='xform.xsl' ``` @@ -342,7 +342,7 @@ Console.WriteLine(pi.NodeType.ToString) This example produces the following output: -``` +```txt ProcessingInstruction ``` @@ -416,7 +416,7 @@ Console.WriteLine(pi.Target) This example produces the following output: -``` +```txt xml-stylesheet ``` diff --git a/xml/System.Xml.Linq/XStreamingElement.xml b/xml/System.Xml.Linq/XStreamingElement.xml index 6c57ae50a36..c533627aece 100644 --- a/xml/System.Xml.Linq/XStreamingElement.xml +++ b/xml/System.Xml.Linq/XStreamingElement.xml @@ -124,7 +124,7 @@ Console.WriteLine(dstTree2) This example produces the following output: -``` +```txt 3 4 @@ -142,7 +142,7 @@ Console.WriteLine(dstTree2) The following text file, People.txt, is the source for this example. -``` +```txt #This is a comment 1,Tai,Yee,Writer 2,Nikolay,Grachev,Programmer @@ -593,7 +593,7 @@ Console.WriteLine(dstTree) This example produces the following output: -``` +```xml 3 4 @@ -1161,7 +1161,7 @@ Console.WriteLine(dstTree.Name) This example produces the following output: -``` +```txt NewRoot ``` @@ -1868,7 +1868,7 @@ Console.WriteLine(File.ReadAllText("Test2.xml")) This example produces the following output: -``` +```txt 3 ------ @@ -2001,7 +2001,7 @@ Console.WriteLine(dstTree.ToString()) This example produces the following output: -``` +```txt 3 ------ @@ -2117,7 +2117,7 @@ Console.WriteLine(dstTree.ToString()) This example produces the following output: -``` +```txt 3 ------ diff --git a/xml/System.Xml.Schema/XmlSchemaCollection.xml b/xml/System.Xml.Schema/XmlSchemaCollection.xml index a70eb9b357f..815e79f23fd 100644 --- a/xml/System.Xml.Schema/XmlSchemaCollection.xml +++ b/xml/System.Xml.Schema/XmlSchemaCollection.xml @@ -422,7 +422,7 @@ ## Remarks If `ns` has already been associated with another schema in the collection, the schema being added replaces the original schema in the collection. For example, in the following C# code, authors.xsd is removed from the collection and names.xsd is added. -``` +```csharp schemaColl.Add("urn:author", "authors.xsd"); schemaColl.Add("urn:author", "names.xsd"); ``` diff --git a/xml/System.Xml.Schema/XmlSchemaSet.xml b/xml/System.Xml.Schema/XmlSchemaSet.xml index 5a25ba996bb..3183460fe49 100644 --- a/xml/System.Xml.Schema/XmlSchemaSet.xml +++ b/xml/System.Xml.Schema/XmlSchemaSet.xml @@ -421,7 +421,7 @@ foreach(XmlSchema schema in schemaSet.Schemas("http://www.contoso.com/books")) - W3C XML Schema allows schemas without a target namespace to be included in schemas with a target namespace defined. In this case, the schema without a target namespace defined is coerced into the target namespace of the including schema. The included schema is treated as if it had that target namespace defined. Similarly, schemas without a target namespace can be added to the and coerced into the target namespace specified by the method, as illustrated in the following example. -``` +```xml @@ -1325,7 +1325,7 @@ foreach (XmlSchema schema in schemaSet.Schemas()) If the specified schema imports other schemas and the specified schema was previously removed with the method, the method will not remove the imported schemas and will return `false`. For example, if `parentSchema` imports `childSchema1` and `childSchema2` the following code will only remove `parentSchema`, but not the imported `childSchema1` and `childSchema2` schemas: -``` +```csharp XmlSchemaSet ss = new XmlSchemaSet(); XmlSchema xs = XmlSchema.Read(XmlReader.Create("parentSchema.xsd"), null); ss.Add(xs); @@ -1338,7 +1338,7 @@ ss.Compile(); The following code will remove the `parentSchema` and the imported schemas: -``` +```csharp XmlSchemaSet ss = new XmlSchemaSet(); XmlSchema xs = XmlSchema.Read(XmlReader.Create("parentSchema.xsd"), null); ss.Add(xs); diff --git a/xml/System.Xml.Serialization/XmlAttributeEventArgs.xml b/xml/System.Xml.Serialization/XmlAttributeEventArgs.xml index b31ff71a068..a8caf2b1176 100644 --- a/xml/System.Xml.Serialization/XmlAttributeEventArgs.xml +++ b/xml/System.Xml.Serialization/XmlAttributeEventArgs.xml @@ -62,7 +62,7 @@ ## Examples The following example deserializes a class named `Group` from a file named UnknownAttributes.xml. Whenever an element is found in the file that has no corresponding member in the class, the event occurs. To try the example, paste the following XML code into a file named UnknownAttributes.xml. -``` +```xml MyGroup @@ -128,7 +128,7 @@ ## Examples The following example deserializes a class named `Group` from a file named UnknownAttributes.xml. Whenever an element is found in the file that has no corresponding member in the class, the event occurs. To try the example, paste the following XML code into a file named UnknownAttributes.xml. -``` +```xml MyGroup @@ -235,7 +235,7 @@ ## Examples The following example deserializes a class named `Group` from a file named UnknownAttributes.xml. Whenever an element is found in the file that has no corresponding member in the class, the event occurs. To try the example, paste the following XML code into a file named UnknownAttributes.xml. -``` +```xml MyGroup @@ -300,7 +300,7 @@ ## Examples The following example deserializes a class named `Group` from a file named UnknownAttributes.xml. Whenever an element is found in the file that has no corresponding member in the class, the event occurs. To try the example, paste the following XML code into a file named UnknownAttributes.xml. -``` +```xml MyGroup diff --git a/xml/System.Xml.Serialization/XmlAttributes.xml b/xml/System.Xml.Serialization/XmlAttributes.xml index 81bf60a3266..80c16cb2093 100644 --- a/xml/System.Xml.Serialization/XmlAttributes.xml +++ b/xml/System.Xml.Serialization/XmlAttributes.xml @@ -664,7 +664,7 @@ ## Remarks You can specify the default value of an XML element or XML attribute by applying a to a member. To examine the result of applying the value, compile the application into a DLL or executable, and pass the resulting file as an argument to the XML Schema Definition tool (XSD.exe). In the XML schema document, a default value is assigned to the `default` attribute. In the following example, the default for the \ element is "Dogs." -``` +```xml event occurs. To try the example, paste the following XML code into a file named UnknownElements.xml. -``` +```xml MyGroup @@ -3312,7 +3312,7 @@ The following example contains two main classes: `PurchaseOrder` and `Test`. The Documents that conform to section 5 are in a special format. At the very least, such a document includes the main body of the SOAP message. However, rather than having all types defined inline in the document, some type definitions can be encoded as references to top-level elements in the document. Thus, for every element found in the main body that is a reference, there must be a corresponding element that contains the type definition. To correlate the referencing element and the type definition, the type definition has an `id` attribute set to a unique string ID and the referencing element has an `href` attribute that references the same ID. -``` +```xml 10000 @@ -3331,7 +3331,7 @@ The following example contains two main classes: `PurchaseOrder` and `Test`. The ## Examples The following example adds an to an . The event is handled by the `Serializer``_``UnreferencedObject` method. To run the example, cut and paste the following XML into a file named "UnrefObj.xml". -``` +```xml diff --git a/xml/System.Xml.XPath/XPathNavigator.xml b/xml/System.Xml.XPath/XPathNavigator.xml index f9e40496339..f6d403470ce 100644 --- a/xml/System.Xml.XPath/XPathNavigator.xml +++ b/xml/System.Xml.XPath/XPathNavigator.xml @@ -288,7 +288,6 @@ The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -315,7 +314,6 @@ 9.99 - ``` ]]> @@ -394,7 +392,6 @@ The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -421,7 +418,6 @@ 9.99 - ``` ]]> @@ -490,8 +486,6 @@ - The method does not affect the position of the . - - ## Examples In the following example, a new `pages` child element is appended to the list of child elements of the first `book` element in the `contosoBooks.xml` file using the object specified. The `http://www.contoso.com/books` namespace is specified so that the new child element is appended using the same namespace as the XML document. @@ -502,7 +496,6 @@ The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -529,7 +522,6 @@ 9.99 - ``` ]]> @@ -611,7 +603,6 @@ The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -638,7 +629,6 @@ 9.99 - ``` ]]> @@ -740,7 +730,6 @@ navigator.AppendChildElement(navigator.Prefix, "pages", LookupNamespaceURI(navig The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -767,7 +756,6 @@ navigator.AppendChildElement(navigator.Prefix, "pages", LookupNamespaceURI(navig 9.99 - ``` ]]> @@ -898,7 +886,6 @@ navigator.AppendChildElement(navigator.Prefix, "pages", LookupNamespaceURI(navig The example takes the `books.xml` file as an input. ```xml - @@ -925,7 +912,6 @@ navigator.AppendChildElement(navigator.Prefix, "pages", LookupNamespaceURI(navig 9.99 - ``` ]]> @@ -1090,7 +1076,6 @@ navigator.AppendChildElement(navigator.Prefix, "pages", LookupNamespaceURI(navig 9.99 - ``` ]]> @@ -1334,7 +1319,6 @@ editor.CreateAttribute(navigator.Prefix, "attributeName", LookupNamespace(naviga The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -1361,7 +1345,6 @@ editor.CreateAttribute(navigator.Prefix, "attributeName", LookupNamespace(naviga 9.99 - ``` ]]> @@ -1442,7 +1425,6 @@ editor.CreateAttribute(navigator.Prefix, "attributeName", LookupNamespace(naviga The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -1469,7 +1451,6 @@ editor.CreateAttribute(navigator.Prefix, "attributeName", LookupNamespace(naviga 9.99 - ``` ]]> @@ -1601,7 +1582,6 @@ editor.CreateAttribute(navigator.Prefix, "attributeName", LookupNamespace(naviga The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -1628,7 +1608,6 @@ editor.CreateAttribute(navigator.Prefix, "attributeName", LookupNamespace(naviga 9.99 - ``` ]]> @@ -1708,7 +1687,6 @@ editor.CreateAttribute(navigator.Prefix, "attributeName", LookupNamespace(naviga The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -1735,7 +1713,6 @@ editor.CreateAttribute(navigator.Prefix, "attributeName", LookupNamespace(naviga 9.99 - ``` ]]> @@ -1826,7 +1803,6 @@ nav.Evaluate("Price/text()*10"); The example takes the `books.xml` file as an input. ```xml - @@ -1853,7 +1829,6 @@ nav.Evaluate("Price/text()*10"); 9.99 - ``` ]]> @@ -1943,7 +1918,6 @@ nav.Evaluate(expr); The example takes the `books.xml` file as an input. ```xml - @@ -1970,7 +1944,6 @@ nav.Evaluate(expr); 9.99 - ``` ]]> @@ -2064,7 +2037,6 @@ nav.Evaluate(expr); The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -2091,7 +2063,6 @@ nav.Evaluate(expr); 9.99 - ``` ]]> @@ -2184,7 +2155,6 @@ nav.Evaluate(expr); The example takes the `books.xml` file as an input. ```xml - @@ -2211,7 +2181,6 @@ nav.Evaluate(expr); 9.99 - ``` ]]> @@ -2600,7 +2569,6 @@ nav.Evaluate(expr); The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -2627,7 +2595,6 @@ nav.Evaluate(expr); 9.99 - ``` ]]> @@ -2710,7 +2677,6 @@ nav.Evaluate(expr); The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -2737,7 +2703,6 @@ nav.Evaluate(expr); 9.99 - ``` ]]> @@ -2814,7 +2779,6 @@ nav.Evaluate(expr); The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -2841,7 +2805,6 @@ nav.Evaluate(expr); 9.99 - ``` ]]> @@ -2920,7 +2883,6 @@ nav.Evaluate(expr); The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -2947,7 +2909,6 @@ nav.Evaluate(expr); 9.99 - ``` ]]> @@ -3027,7 +2988,6 @@ nav.Evaluate(expr); The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -3054,7 +3014,6 @@ nav.Evaluate(expr); 9.99 - ``` ]]> @@ -3139,7 +3098,6 @@ nav.Evaluate(expr); The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -3166,7 +3124,6 @@ nav.Evaluate(expr); 9.99 - ``` ]]> @@ -3243,7 +3200,6 @@ nav.Evaluate(expr); The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -3270,7 +3226,6 @@ nav.Evaluate(expr); 9.99 - ``` ]]> @@ -3349,7 +3304,6 @@ nav.Evaluate(expr); The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -3376,7 +3330,6 @@ nav.Evaluate(expr); 9.99 - ``` ]]> @@ -3456,7 +3409,6 @@ nav.Evaluate(expr); The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -3483,7 +3435,6 @@ nav.Evaluate(expr); 9.99 - ``` ]]> @@ -3583,7 +3534,6 @@ navigator.InsertElementAfter(navigator.Prefix, "pages", LookupNamespaceURI(navig The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -3610,7 +3560,6 @@ navigator.InsertElementAfter(navigator.Prefix, "pages", LookupNamespaceURI(navig 9.99 - ``` ]]> @@ -3709,7 +3658,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -3736,7 +3684,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi 9.99 - ``` ]]> @@ -4057,7 +4004,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi The example takes the `books.xml` file as an input. ```xml - @@ -4084,7 +4030,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi 9.99 - ``` ]]> @@ -4372,7 +4317,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi The example uses the file, `books.xml`, as input. ```xml - @@ -4399,7 +4343,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi 9.99 - ``` ]]> @@ -4789,7 +4732,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi The example takes the `books.xml` file as an input. ```xml - @@ -4816,7 +4758,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi 9.99 - ``` ]]> @@ -5136,7 +5077,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -5163,7 +5103,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi 9.99 - ``` ]]> @@ -5242,7 +5181,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -5269,7 +5207,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi 9.99 - ``` ]]> @@ -5352,7 +5289,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -5379,7 +5315,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi 9.99 - ``` ]]> @@ -5469,7 +5404,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -5496,7 +5430,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi 9.99 - ``` ]]> @@ -5700,7 +5633,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi The example takes the `books.xml` file as an input. ```xml - @@ -5727,7 +5659,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi 9.99 - ``` ]]> @@ -5919,7 +5850,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi The example takes the `books.xml` file as an input. ```xml - @@ -5946,7 +5876,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi 9.99 - ``` ]]> @@ -6358,7 +6287,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi The example takes the `books.xml` file as an input. ```xml - @@ -6385,7 +6313,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi 9.99 - ``` ]]> @@ -6458,7 +6385,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi The example takes the `books.xml` file as an input. ```xml - @@ -6485,7 +6411,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi 9.99 - ``` ]]> @@ -6612,7 +6537,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi The example takes the `books.xml` file as an input. ```xml - @@ -6639,7 +6563,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi 9.99 - ``` ]]> @@ -6701,7 +6624,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi The example takes the `books.xml` file as an input. ```xml - @@ -6728,7 +6650,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi 9.99 - ``` ]]> @@ -6802,7 +6723,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -6829,7 +6749,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi 9.99 - ``` ]]> @@ -6896,7 +6815,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi The example takes the `books.xml` file as an input. ```xml - @@ -6923,7 +6841,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi 9.99 - ``` ]]> @@ -7007,7 +6924,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -7034,7 +6950,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi 9.99 - ``` ]]> @@ -7113,7 +7028,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -7140,7 +7054,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi 9.99 - ``` ]]> @@ -7221,7 +7134,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -7248,7 +7160,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi 9.99 - ``` ]]> @@ -7330,7 +7241,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -7357,7 +7267,6 @@ navigator.InsertElementBefore(navigator.Prefix, "pages", LookupNamespaceURI(navi 9.99 - ``` ]]> @@ -7459,7 +7368,6 @@ navigator.PrependChildElement(navigator.Prefix, "pages", LookupNamespaceURI(navi The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -7486,7 +7394,6 @@ navigator.PrependChildElement(navigator.Prefix, "pages", LookupNamespaceURI(navi 9.99 - ``` ]]> @@ -7567,7 +7474,6 @@ navigator.PrependChildElement(navigator.Prefix, "pages", LookupNamespaceURI(navi The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -7594,7 +7500,6 @@ navigator.PrependChildElement(navigator.Prefix, "pages", LookupNamespaceURI(navi 9.99 - ``` ]]> @@ -7668,7 +7573,6 @@ navigator.PrependChildElement(navigator.Prefix, "pages", LookupNamespaceURI(navi The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -7695,7 +7599,6 @@ navigator.PrependChildElement(navigator.Prefix, "pages", LookupNamespaceURI(navi 9.99 - ``` ]]> @@ -7784,7 +7687,6 @@ navigator.PrependChildElement(navigator.Prefix, "pages", LookupNamespaceURI(navi The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -7811,7 +7713,6 @@ navigator.PrependChildElement(navigator.Prefix, "pages", LookupNamespaceURI(navi 9.99 - ``` ]]> @@ -7892,7 +7793,6 @@ navigator.PrependChildElement(navigator.Prefix, "pages", LookupNamespaceURI(navi The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -7919,7 +7819,6 @@ navigator.PrependChildElement(navigator.Prefix, "pages", LookupNamespaceURI(navi 9.99 - ``` ]]> @@ -8001,7 +7900,6 @@ navigator.PrependChildElement(navigator.Prefix, "pages", LookupNamespaceURI(navi The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -8028,7 +7926,6 @@ navigator.PrependChildElement(navigator.Prefix, "pages", LookupNamespaceURI(navi 9.99 - ``` ]]> @@ -8189,7 +8086,6 @@ while (iterator.MoveNext()) The example takes the `books.xml` file as an input. ```xml - @@ -8216,7 +8112,6 @@ while (iterator.MoveNext()) 9.99 - ``` ]]> @@ -8358,7 +8253,6 @@ XPathNodeIterator ni = nav.Select(expr); The example takes the `books.xml` file as an input. ```xml - @@ -8385,7 +8279,6 @@ XPathNodeIterator ni = nav.Select(expr); 9.99 - ``` ]]> @@ -8467,7 +8360,6 @@ XPathNodeIterator ni = nav.Select(expr); The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -8494,7 +8386,6 @@ XPathNodeIterator ni = nav.Select(expr); 9.99 - ``` ]]> @@ -8648,7 +8539,6 @@ XPathNodeIterator ni = nav.Select(expr); The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -8675,7 +8565,6 @@ XPathNodeIterator ni = nav.Select(expr); 9.99 - ``` ]]> @@ -9060,7 +8949,6 @@ XPathNodeIterator ni = nav.Select(expr); The example takes the `books.xml` file as an input. ```xml - @@ -9087,7 +8975,6 @@ XPathNodeIterator ni = nav.Select(expr); 9.99 - ``` ]]> @@ -9166,7 +9053,6 @@ XPathNodeIterator ni = nav.Select(expr); The example takes the `books.xml` file as an input. ```xml - @@ -9193,7 +9079,6 @@ XPathNodeIterator ni = nav.Select(expr); 9.99 - ``` ]]> @@ -9278,7 +9163,6 @@ XPathNodeIterator ni = nav.Select(expr); The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -9305,7 +9189,6 @@ XPathNodeIterator ni = nav.Select(expr); 9.99 - ``` ]]> @@ -9378,7 +9261,6 @@ XPathNodeIterator ni = nav.Select(expr); The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -9405,7 +9287,6 @@ XPathNodeIterator ni = nav.Select(expr); 9.99 - ``` ]]> @@ -9481,7 +9362,6 @@ XPathNodeIterator ni = nav.Select(expr); The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -9508,7 +9388,6 @@ XPathNodeIterator ni = nav.Select(expr); 9.99 - ``` ]]> @@ -10251,7 +10130,6 @@ XPathNodeIterator ni = nav.Select(expr); The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -10278,13 +10156,11 @@ XPathNodeIterator ni = nav.Select(expr); 9.99 - ``` The example also takes the `contosoBooks.xsd` as an input. ```xml - @@ -10314,7 +10190,6 @@ XPathNodeIterator ni = nav.Select(expr); - ``` ]]> @@ -10400,7 +10275,6 @@ XPathNodeIterator ni = nav.Select(expr); The example takes the `contosoBooks.xml` file as an input. ```xml - @@ -10427,7 +10301,6 @@ XPathNodeIterator ni = nav.Select(expr); 9.99 - ``` ]]> diff --git a/xml/System.Xml.Xsl/XslTransform.xml b/xml/System.Xml.Xsl/XslTransform.xml index 7f4f3816743..877eebc7a3e 100644 --- a/xml/System.Xml.Xsl/XslTransform.xml +++ b/xml/System.Xml.Xsl/XslTransform.xml @@ -1342,9 +1342,9 @@ Console.WriteLine("Passing " + tmpDoc.OuterXml + " to print_root.xsl"); xslt.Transform(tmpDoc, null, Console.Out); ``` - The example uses the `library.xml` and `print_root.xsl` files as input and outputs the following to the console. + The example uses the `library.xml` and `print_root.xsl` files as input, and outputs the following to the console. -``` +```txt Passing Pride And Prejudice to print_root.xsl Root node is book. ``` @@ -1638,9 +1638,9 @@ Console.WriteLine("Passing " + tmpDoc.OuterXml + " to print_root.xsl"); xslt.Transform(tmpDoc, null, Console.Out); ``` - The example uses the `library.xml` and `print_root.xsl` files as input and outputs the following to the console. + The example uses the `library.xml` and `print_root.xsl` files as input, and outputs the following to the console. -``` +```txt Passing Pride And Prejudice to print_root.xsl Root node is book. ``` @@ -1773,9 +1773,9 @@ Console.WriteLine("Passing " + tmpDoc.OuterXml + " to print_root.xsl"); xslt.Transform(tmpDoc, null, Console.Out); ``` - The example uses the `library.xml` and `print_root.xsl` files as input and outputs the following to the console. + The example uses the `library.xml` and `print_root.xsl` files as input, and outputs the following to the console. -``` +```txt Passing Pride And Prejudice to print_root.xsl Root node is book. ``` @@ -1909,9 +1909,9 @@ Console.WriteLine("Passing " + tmpDoc.OuterXml + " to print_root.xsl"); xslt.Transform(tmpDoc, null, Console.Out, null); ``` - The example uses the `library.xml` and `print_root.xsl` files as input and outputs the following to the console. + The example uses the `library.xml` and `print_root.xsl` files as input, and outputs the following to the console. -``` +```txt Passing Pride And Prejudice to print_root.xsl Root node is book. ``` @@ -2049,9 +2049,9 @@ Console.WriteLine("Passing " + tmpDoc.OuterXml + " to print_root.xsl"); xslt.Transform(tmpDoc, null, Console.Out); ``` - The example uses the `library.xml` and `print_root.xsl` files as input and outputs the following to the console. + The example uses the `library.xml` and `print_root.xsl` files as input, and outputs the following to the console. -``` +```txt Passing Pride And Prejudice to print_root.xsl Root node is book. ``` @@ -2527,9 +2527,9 @@ Console.WriteLine("Passing " + tmpDoc.OuterXml + " to print_root.xsl"); xslt.Transform(tmpDoc, null, Console.Out, null); ``` - The example uses the `library.xml` and `print_root.xsl` files as input and outputs the following to the console. + The example uses the `library.xml` and `print_root.xsl` files as input, and outputs the following to the console. -``` +```txt Passing Pride And Prejudice to print_root.xsl Root node is book. ``` @@ -2674,9 +2674,9 @@ Console.WriteLine("Passing " + tmpDoc.OuterXml + " to print_root.xsl"); xslt.Transform(tmpDoc, null, Console.Out, null); ``` - The example uses the `library.xml` and `print_root.xsl` files as input and outputs the following to the console. + The example uses the `library.xml` and `print_root.xsl` files as input, and outputs the following to the console. -``` +```txt Passing Pride And Prejudice to print_root.xsl Root node is book. ``` @@ -2823,9 +2823,9 @@ Console.WriteLine("Passing " + tmpDoc.OuterXml + " to print_root.xsl"); xslt.Transform(tmpDoc, null, Console.Out, null); ``` - The example uses the `library.xml` and `print_root.xsl` files as input and outputs the following to the console. + The example uses the `library.xml` and `print_root.xsl` files as input, and outputs the following to the console. -``` +```txt Passing Pride And Prejudice to print_root.xsl Root node is book. ``` diff --git a/xml/System.Xml/XmlDictionaryWriter.xml b/xml/System.Xml/XmlDictionaryWriter.xml index a1ed562f781..149f05305fa 100644 --- a/xml/System.Xml/XmlDictionaryWriter.xml +++ b/xml/System.Xml/XmlDictionaryWriter.xml @@ -180,7 +180,6 @@ for (int i = 0; i < 10000; i++) binarywriter.WriteValue(largeStr); } binarywriter.WriteEndAttribute(); - ``` In the previous sample the code buffers about 1 GB of memory, while in the other writers it writes the values as they are provided. diff --git a/xml/System.Xml/XmlDocument.xml b/xml/System.Xml/XmlDocument.xml index 8e4ad0b91c1..0f87bcae068 100644 --- a/xml/System.Xml/XmlDocument.xml +++ b/xml/System.Xml/XmlDocument.xml @@ -1108,16 +1108,17 @@ ``` @@ -1200,16 +1201,17 @@ elem=doc.CreateElement("xy:item", "urn:abc"); ``` @@ -1285,17 +1287,11 @@ elem=doc.CreateElement("xy", "item", "urn:abc"); The namespaces used in the replacement text for the entity reference are bound at the time the parent of the entity reference node is first set (for example, when the entity reference node is inserted into the document). For example, given the following entity: -``` +```dtd test"> ``` - If you call `CreateEntityReference("a")` you get back a single node of type EntityReference with no children. If you append this node as a child of the following node, - -``` - -``` - - then, at the time of calling , the parent of the newly created entity reference node is set and the children are expanded in this namespace context. The child element node `b` will have NamespaceURI equal to `urn:1`. The child nodes of the entity reference remain the same even if you move the entity reference to a place in the document that has a different default namespace context. This does not happen for existing entity reference nodes when you remove and insert them or for entity references that you clone with . It only happens for newly created entity references. + If you call `CreateEntityReference("a")`, you get back a single node of type EntityReference with no children. If you append this node as a child of the following node, ``, then, at the time of calling , the parent of the newly created entity reference node is set and the children are expanded in this namespace context. The child element node `b` will have NamespaceURI equal to `urn:1`. The child nodes of the entity reference remain the same even if you move the entity reference to a place in the document that has a different default namespace context. This does not happen for existing entity reference nodes when you remove and insert them or for entity references that you clone with . It only happens for newly created entity references. If the corresponding entity is not defined in the DocumentType when the entity reference node is added, because the entity reference is not defined, its only child node will be an empty text node. @@ -2266,7 +2262,7 @@ elem=doc.CreateElement("xy", "item", "urn:abc"); **Output:** -``` +```xml Pride And Prejudice ``` diff --git a/xml/System.Xml/XmlNamespaceManager.xml b/xml/System.Xml/XmlNamespaceManager.xml index c3e1e15e168..6bc13aef348 100644 --- a/xml/System.Xml/XmlNamespaceManager.xml +++ b/xml/System.Xml/XmlNamespaceManager.xml @@ -720,7 +720,6 @@ Loop ```vb Dim prefix As String = nsMgr.LookupPrefix("urn:samples") writer.WriteStartAttribute(prefix, "ISBN", "urn:samples") - ``` ```csharp @@ -741,12 +740,11 @@ writer.WriteEndElement() s = writer.LookupPrefix("book") CError.Compare(s, Nothing, "Error in root element") writer.WriteEndElement() - ``` **Output** -``` +```xml diff --git a/xml/System.Xml/XmlNode.xml b/xml/System.Xml/XmlNode.xml index 7c8f7937eb1..3a5dd281656 100644 --- a/xml/System.Xml/XmlNode.xml +++ b/xml/System.Xml/XmlNode.xml @@ -165,7 +165,7 @@ **Output:** -``` +```txt Display the modified XML... @@ -336,9 +336,9 @@ Display the modified XML... &xyz; ``` - where the DTD file contains the following: +Where the DTD file contains the following: -``` +```dtd My Data @@ -1081,7 +1081,7 @@ Display the modified XML... **Output:** -``` +```txt Display the InnerText of the element... some textmore text Display the InnerXml of the element... @@ -3235,14 +3235,12 @@ nodeList = root.SelectNodes("//ab:book[contains(ab:title,""'Emma'"")]", nsmgr) The following Visual Basic code selects an element that contains single quotes: -``` +```vb book = root.SelectSingleNode("descendant::book[title=""'Emma'""]") ``` This method is a Microsoft extension to the Document Object Model (DOM). - - ## Examples The following example changes the price of the first Jane Austen book. diff --git a/xml/System.Xml/XmlReader.xml b/xml/System.Xml/XmlReader.xml index 3239e9d131c..6f5ce6beeff 100644 --- a/xml/System.Xml/XmlReader.xml +++ b/xml/System.Xml/XmlReader.xml @@ -2240,7 +2240,7 @@ public class Sample `book.dtd` -``` +```dtd asynchronous method was called without The Meaning of Pizza - ``` ]]> @@ -8720,14 +8719,12 @@ An method was called before a previous asy - ``` ```csharp XmlTextReader reader = newXmlTextReader("sample.xml"); reader.ReadToFollowing("item"); - ``` This method can be called on all node types. @@ -8798,14 +8795,12 @@ reader.ReadToFollowing("item"); - ``` ```csharp XmlTextReader reader = newXmlTextReader("sample.xml"); reader.ReadToFollowing("item", "urn:1"); - ``` This method can be called on all node types. diff --git a/xml/System.Xml/XmlReaderSettings.xml b/xml/System.Xml/XmlReaderSettings.xml index ab3dc214f6f..691ed383a31 100644 --- a/xml/System.Xml/XmlReaderSettings.xml +++ b/xml/System.Xml/XmlReaderSettings.xml @@ -1014,7 +1014,7 @@ End Try This example produces the following output: -``` +```txt There is an error in XML document (MaxCharactersFromEntities, ). ``` @@ -1119,7 +1119,7 @@ End Try This code produces the following output: -``` +```txt There is an error in XML document (MaxCharactersInDocument, ). ``` diff --git a/xml/System.Xml/XmlTextReader.xml b/xml/System.Xml/XmlTextReader.xml index 6aa4d77f4c4..f1d0a82c8d6 100644 --- a/xml/System.Xml/XmlTextReader.xml +++ b/xml/System.Xml/XmlTextReader.xml @@ -1579,7 +1579,7 @@ XmlTextReader reader = new XmlTextReader(s); To illustrate the difference between the entity handling modes consider the following XML: -``` +```xml ]> A # ``` @@ -2512,14 +2512,13 @@ If the reader is positioned on a `DocumentType` node, this method can be used to ## Remarks -> [!NOTE] -> Starting with the .NET Framework 2.0, we recommend that you create instances by using the method to take advantage of new functionality. +> We recommend that you create instances by using the method to take advantage of new functionality. This property is most commonly used for error reporting, but can be called at any time. The property's starting value is `1`. The position indicated is the first character of text in the markup. -``` +```xml abc diff --git a/xml/System.Xml/XmlWriter.xml b/xml/System.Xml/XmlWriter.xml index 02c07da8ac7..d33382fd843 100644 --- a/xml/System.Xml/XmlWriter.xml +++ b/xml/System.Xml/XmlWriter.xml @@ -6306,13 +6306,13 @@ An asynchronous method was called without - The default behavior of an created using is to throw an when attempting to write character values in the range 0x-0x1F (excluding white space characters 0x9, 0xA, and 0xD). These invalid XML characters can be written by creating the with the property set to `false`. Doing so will result in the characters being replaced with numeric character entities (&\#0; through �x1F). Additionally, an created with the `new` operator will replace the invalid characters with numeric character entities by default. - **Note** Microsoft does not encourage the practice of writing invalid XML characters since many applications that consume XML are not designed to handle invalid characters. + **Note** Microsoft does not encourage the practice of writing invalid XML characters, since many applications that consume XML are not designed to handle invalid characters. - If `WriteString` is called in the context of an attribute value, double and single quotes are replaced with `"` and `'` respectively. For example, this input string `testtest` is written out as -``` +```txt test<item>test ``` From ad752710ff84041d54d53ce868f683c8fc5a697f Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 23 Apr 2025 20:32:48 -0700 Subject: [PATCH 14/16] add language slugs (#11224) --- .../MatchCollection.xml | 2 +- xml/System.Text.RegularExpressions/Regex.xml | 14 +++++----- xml/System.Text/Encoding.xml | 4 --- .../TransactionEventArgs.xml | 14 +++++----- xml/System/Byte.xml | 2 +- xml/System/DateTime.xml | 4 +-- xml/System/Environment.xml | 4 +-- xml/System/Math.xml | 4 +-- xml/System/MathF.xml | 4 +-- xml/System/ObjectDisposedException.xml | 2 +- xml/System/String.xml | 4 +-- xml/System/TimeZoneInfo.xml | 20 +++++-------- xml/System/Type.xml | 28 +++++++++---------- 13 files changed, 48 insertions(+), 58 deletions(-) diff --git a/xml/System.Text.RegularExpressions/MatchCollection.xml b/xml/System.Text.RegularExpressions/MatchCollection.xml index d830446672a..3ee8714070c 100644 --- a/xml/System.Text.RegularExpressions/MatchCollection.xml +++ b/xml/System.Text.RegularExpressions/MatchCollection.xml @@ -555,7 +555,7 @@ A collection that is read-only does not allow the addition or removal of element The example produces the following output: -``` +```txt Half house huge diff --git a/xml/System.Text.RegularExpressions/Regex.xml b/xml/System.Text.RegularExpressions/Regex.xml index 2383ec5a5de..1144af68573 100644 --- a/xml/System.Text.RegularExpressions/Regex.xml +++ b/xml/System.Text.RegularExpressions/Regex.xml @@ -2986,7 +2986,7 @@ Allows an to attempt to free resources and perfor The regular expression pattern is: -``` +```txt ^[a-zA-Z0-9]\d{2}[a-zA-Z0-9](-\d{3}){2}[A-Za-z0-9]$ ``` @@ -3169,7 +3169,7 @@ For more details about `startat`, see the Remarks section of method with the `options` parameter set to is equivalent to defining the following regular expression: -``` +```txt [a-zA-Z0-9]\d{2}[a-zA-Z0-9](-\d{3}){2}[A-Za-z0-9] ``` @@ -3619,7 +3619,7 @@ For more details about `startat`, see the Remarks section of method with the `options` parameter set to is equivalent to defining the following regular expression: -``` +```txt [a-zA-Z0-9]\d{2}[a-zA-Z0-9](-\d{3}){2}[A-Za-z0-9] ``` diff --git a/xml/System.Text/Encoding.xml b/xml/System.Text/Encoding.xml index e8d9d04d1a1..ed59e24cd76 100644 --- a/xml/System.Text/Encoding.xml +++ b/xml/System.Text/Encoding.xml @@ -4354,14 +4354,12 @@ In .NET 5 and later versions, the code page name `utf-7` is not supported. The example uses the following text, which should be saved to a UTF-8 encoded file named Utf8Example.txt. ```txt - This is a UTF-8-encoded file that contains primarily Latin text, although it does list the first twelve letters of the Russian (Cyrillic) alphabet: А б в г д е ё ж з и й к The goal is to save this file, then open and decode it as a binary stream. - ``` ]]> @@ -4597,14 +4595,12 @@ The goal is to save this file, then open and decode it as a binary stream. The example uses the following text, which should be saved to a UTF-8 encoded file named Utf8Example.txt. ```txt - This is a UTF-8-encoded file that contains primarily Latin text, although it does list the first twelve letters of the Russian (Cyrillic) alphabet: А б в г д е ё ж з и й к The goal is to save this file, then open and decode it as a binary stream. - ``` ]]> diff --git a/xml/System.Transactions/TransactionEventArgs.xml b/xml/System.Transactions/TransactionEventArgs.xml index 2c1c2ddd8f5..82590be0ebb 100644 --- a/xml/System.Transactions/TransactionEventArgs.xml +++ b/xml/System.Transactions/TransactionEventArgs.xml @@ -49,16 +49,16 @@ Provides data for the following transaction events: , . - getdouble 123 Result: 246 Completed Successfully diff --git a/xml/System/Math.xml b/xml/System/Math.xml index 027d3c2362d..6ee3870137c 100644 --- a/xml/System/Math.xml +++ b/xml/System/Math.xml @@ -3883,13 +3883,13 @@ Dim i2 As Integer = CInt(Math.Floor(d2)) ' Result: 7968 The method is not the same as the [remainder operator](/dotnet/csharp/language-reference/operators/remainder-operator). Although both return the remainder after division, the formulas they use are different. The formula for the method is: -``` +```txt IEEERemainder = dividend - (divisor * Math.Round(dividend / divisor)) ``` In contrast, the formula for the remainder operator is: -``` +```txt Remainder = (Math.Abs(dividend) - (Math.Abs(divisor) * (Math.Floor(Math.Abs(dividend) / Math.Abs(divisor))))) * Math.Sign(dividend) diff --git a/xml/System/MathF.xml b/xml/System/MathF.xml index 26c61d41316..35adc1b4068 100644 --- a/xml/System/MathF.xml +++ b/xml/System/MathF.xml @@ -1177,13 +1177,13 @@ The value of this constant is 2.71828175. The method is not the same as the [remainder operator](/dotnet/csharp/language-reference/operators/remainder-operator). Although both return the remainder after division, the formulas they use are different. The formula for the method is: -``` +```txt IEEERemainder = dividend - (divisor * MathF.Round(dividend / divisor)) ``` In contrast, the formula for the remainder operator is: -``` +```txt Remainder = (MathF.Abs(dividend) - (MathF.Abs(divisor) * (MathF.Floor(MathF.Abs(dividend) / MathF.Abs(divisor))))) * MathF.Sign(dividend) diff --git a/xml/System/ObjectDisposedException.xml b/xml/System/ObjectDisposedException.xml index ef1575d06c6..3597c4ae365 100644 --- a/xml/System/ObjectDisposedException.xml +++ b/xml/System/ObjectDisposedException.xml @@ -94,7 +94,7 @@ This code produces the following output: -``` +```txt Caught: Cannot access a closed Stream. ``` diff --git a/xml/System/String.xml b/xml/System/String.xml index 1ffd5669bba..b90b4d54a0f 100644 --- a/xml/System/String.xml +++ b/xml/System/String.xml @@ -6680,7 +6680,7 @@ In .NET Framework desktop apps, you can use the [\ or the method to define the starting and ending transition rules for each adjustment rule. +1. Calling either the or the method to define the starting and ending transition rules for each adjustment rule. -2. Calling the method for each adjustment rule. +2. Calling the method for each adjustment rule. -3. Assigning the adjustment rules to an array that can be passed as the `adjustmentRules` parameter. +3. Assigning the adjustment rules to an array that can be passed as the `adjustmentRules` parameter. If `disableDaylightSavingTime` parameter is `false`, the operation of this method is identical to the overload. If `disableDaylightSavingTime` is `true`, the returned object includes no adjustment rules and a property whose value is an empty string. - - ## Examples The following example creates a custom time zone for the Palmer station and Anvers Island in Antarctica. It sets the `disableDaylightSavingTime` parameter in the call to the method to `true`. It then displays the new time zone's daylight saving time name, if one is present, and the number of adjustment rules to confirm that the new time zone has no daylight saving time information. @@ -1621,15 +1617,13 @@ Time zone display names for Windows system time zones follow a fairly standard format. The first portion of the display name is the time zone's base offset from Coordinated Universal Time, which is indicated by the acronym GMT (for Greenwich Mean Time), enclosed in parentheses. For Coordinated Universal Time, the GMT acronym with no offset is enclosed in parentheses. This is followed by a string that identifies the time zone or one or more of the cities, regions, or countries in the time zone. For example: -``` +```txt (GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London (GMT+02:00) Athens, Beirut, Istanbul, Minsk (GMT-02:00) Mid-Atlantic (GMT-07:00) Mountain Time (US & Canada) ``` - - ## Examples The following example retrieves a object that represents the local time zone and outputs its display name, standard time name, and daylight saving time name. The output is displayed for a system in the U.S. Pacific Standard Time zone. diff --git a/xml/System/Type.xml b/xml/System/Type.xml index 63043b2bc19..b44d441489a 100644 --- a/xml/System/Type.xml +++ b/xml/System/Type.xml @@ -336,13 +336,13 @@ The code example uses the to invoke the method to obtain a has two type parameters. A of `MyType` with keys of type might be represented as follows: -``` +```txt System.Collections.Generic.Dictionary`2[System.String,MyType] ``` To specify an assembly-qualified type within a type argument list, enclose the assembly-qualified type within brackets. Otherwise, the commas that separate the parts of the assembly-qualified name are interpreted as delimiting additional type arguments. For example, a of `MyType` fromMyAssembly.dll, with keys of type , might be specified as follows: -``` +```txt Type.GetType("System.Collections.Generic.Dictionary`2[System.String,[MyType,MyAssembly]]") ``` @@ -9355,13 +9355,13 @@ Note: In .NET for Win For example, the fully qualified name for a class might look like this: -``` +```txt TopNamespace.SubNameSpace.ContainingClass+NestedClass,MyAssembly ``` If the namespace were TopNamespace.Sub+Namespace, then the string would have to precede the plus sign (+) with an escape character (\\) to prevent it from being interpreted as a nesting separator. Reflection emits this string as follows: -``` +```txt TopNamespace.Sub\+Namespace.ContainingClass+NestedClass,MyAssembly ``` @@ -9377,13 +9377,13 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass,MyAssembly For generic types, the type argument list is enclosed in brackets, and the type arguments are separated by commas. For example, a generic has two type parameters. A of `MyType` with keys of type might be represented as follows: -``` +```txt System.Collections.Generic.Dictionary`2[System.String,MyType] ``` To specify an assembly-qualified type within a type argument list, enclose the assembly-qualified type within brackets. Otherwise, the commas that separate the parts of the assembly-qualified name are interpreted as delimiting additional type arguments. For example, a of `MyType` from MyAssembly.dll, with keys of type , might be specified as follows: -``` +```txt Type.GetType("System.Collections.Generic.Dictionary`2[System.String,[MyType,MyAssembly]]") ``` @@ -9591,13 +9591,13 @@ Note: In .NET for Win For example, the fully qualified name for a class might look like this: -``` +```txt TopNamespace.SubNameSpace.ContainingClass+NestedClass,MyAssembly ``` If the namespace were TopNamespace.Sub+Namespace, then the string would have to precede the plus sign (+) with an escape character (\\) to prevent it from being interpreted as a nesting separator. Reflection emits this string as follows: -``` +```txt TopNamespace.Sub\+Namespace.ContainingClass+NestedClass,MyAssembly ``` @@ -9613,13 +9613,13 @@ TopNamespace.Sub\+Namespace.ContainingClass+NestedClass,MyAssembly For generic types, the type argument list is enclosed in brackets, and the type arguments are separated by commas. For example, a generic has two type parameters. A of `MyType` with keys of type might be represented as follows: -``` +```txt System.Collections.Generic.Dictionary`2[System.String,MyType] ``` To specify an assembly-qualified type within a type argument list, enclose the assembly-qualified type within brackets. Otherwise, the commas that separate the parts of the assembly-qualified name are interpreted as delimiting additional type arguments. For example, a of `MyType` from MyAssembly.dll, with keys of type , might be specified as follows: -``` +```txt Type.GetType("System.Collections.Generic.Dictionary`2[System.String,[MyType,MyAssembly]]") ``` From baf544a7c9fd0d70d21c9e8bdc0f706d2483b615 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 23 Apr 2025 20:56:01 -0700 Subject: [PATCH 15/16] Add language slugs (Security, Threading, Reflection, Runtime) (#11223) --- .../MetadataStringComparer.xml | 13 ++- xml/System.Reflection/AssemblyName.xml | 29 ++--- .../AssemblyVersionAttribute.xml | 110 +++++++++--------- xml/System.Reflection/EventInfo.xml | 8 +- xml/System.Reflection/MethodInfo.xml | 77 +++++------- .../Unsafe.xml | 22 ++-- .../InstancePersistenceContext.xml | 11 +- .../ReturnValueNameAttribute.xml | 4 - .../DataContractSerializer.xml | 15 ++- xml/System.Security.Claims/Claim.xml | 1 - .../ClaimsAuthorizationManager.xml | 6 +- .../X500DistinguishedNameBuilder.xml | 2 +- .../CipherReference.xml | 4 +- xml/System.Security.Cryptography/RSA.xml | 4 +- .../WindowsIdentity.xml | 2 - xml/System.Threading.Tasks/Task.xml | 12 +- xml/System.Threading/SemaphoreSlim.xml | 4 - 17 files changed, 142 insertions(+), 182 deletions(-) diff --git a/xml/System.Reflection.Metadata/MetadataStringComparer.xml b/xml/System.Reflection.Metadata/MetadataStringComparer.xml index 2ee106e9549..e661dd54a29 100644 --- a/xml/System.Reflection.Metadata/MetadataStringComparer.xml +++ b/xml/System.Reflection.Metadata/MetadataStringComparer.xml @@ -47,20 +47,21 @@ No allocation is performed unless both the handle argument and the value argumen Obtain instances using . A default-initialized instance is useless and behaves as a `null` reference. -The code is optimized so that there is no additional overhead in re-obtaining a comparer over assigning it to a local. That is to say that a construct like: +The code is optimized so that there is no additional overhead in reobtaining a comparer over assigning it to a local. That is to say that a construct like: -```cs +```csharp if (reader.StringComparer.Equals(typeDef.Namespace, "System") && reader.StringComparer.Equals(typeDef.Name, "Object") { /* found System.Object */ } ``` -is no less efficient than: -```cs +...is no less efficient than: + +```csharp var comparer = reader.StringComparer; -if (comparer.Equals(typeDef.Namespace, "System") && comparer.Equals(typeDef.Name, "Object") -{ +if (comparer.Equals(typeDef.Namespace, "System") && comparer.Equals(typeDef.Name, "Object") +{ /* found System.Object */ } ``` diff --git a/xml/System.Reflection/AssemblyName.xml b/xml/System.Reflection/AssemblyName.xml index c239bb3de0b..41c520abb9e 100644 --- a/xml/System.Reflection/AssemblyName.xml +++ b/xml/System.Reflection/AssemblyName.xml @@ -112,13 +112,10 @@ ## Remarks The object contains information about an assembly, which you can use to bind to that assembly. An assembly's identity consists of the following: -- Simple name. - -- Version number. - -- Cryptographic key pair. - -- Supported culture. +- Simple name. +- Version number. +- Cryptographic key pair. +- Supported culture. The simple name is typically the file name for the manifest file without its extension. The key pair includes a public and private key, used to create strong-name signatures for assemblies. @@ -146,13 +143,11 @@ To ensure that the names are constructed correctly, use the following properties: -- - -- - -- +- +- +- - You can also get the name by using the `/l` option with the [Gacutil.exe (Global Assembly Cache Tool)](/dotnet/framework/tools/gacutil-exe-gac-tool) + You can also get the name by using the `/l` option with the [Gacutil.exe (Global Assembly Cache Tool)](/dotnet/framework/tools/gacutil-exe-gac-tool). For a partially specified strong name, create an object using the parameterless constructor and set the name and public key. An assembly created using such an can be signed later using the Assembly Linker (Al.exe). @@ -174,18 +169,16 @@ The following example shows an for a simply named assembly with default culture. -``` +```txt ExampleAssembly, Culture="" ``` The following example shows a fully specified reference for a strongly named assembly with culture "en". -``` +```txt ExampleAssembly, Version=1.0.0.0, Culture=en, PublicKeyToken=a5d015c7d5a0b012 ``` - - ## Examples This example shows how to use various reflection classes to analyze the metadata contained in an assembly. @@ -812,7 +805,7 @@ Note: In .NET for Win ## Remarks The display name typically consists of the simple name, version number, supported culture, and public key. For example: -``` +```txt mylib, Version=1.2.1900.0, Culture=neutral, PublicKeyToken=a14f3033def15840 ``` diff --git a/xml/System.Reflection/AssemblyVersionAttribute.xml b/xml/System.Reflection/AssemblyVersionAttribute.xml index 8dc56d418b6..9880085f5fd 100644 --- a/xml/System.Reflection/AssemblyVersionAttribute.xml +++ b/xml/System.Reflection/AssemblyVersionAttribute.xml @@ -68,37 +68,37 @@ Specifies the version of the assembly being attributed. - attribute is used to assign a version number to an assembly. That version number is then stored with the assembly's metadata. - - The assembly version number is part of an assembly's identity and plays a key part in binding to the assembly and in version policy. The default version policy for the runtime is that applications run only with the versions they were built and tested with, unless overridden by explicit version policy in configuration files (the application configuration file, the publisher policy file, and the computer's administrator configuration file). See [Assemblies in .NET](/dotnet/standard/assembly/#assemblies-in-the-common-language-runtime) for more information. - + attribute is used to assign a version number to an assembly. That version number is then stored with the assembly's metadata. + + The assembly version number is part of an assembly's identity and plays a key part in binding to the assembly and in version policy. The default version policy for the runtime is that applications run only with the versions they were built and tested with, unless overridden by explicit version policy in configuration files (the application configuration file, the publisher policy file, and the computer's administrator configuration file). See [Assemblies in .NET](/dotnet/standard/assembly/#assemblies-in-the-common-language-runtime) for more information. + > [!NOTE] -> Version checking only occurs with strong-named assemblies. - - The version number has four parts, as follows: - - \.\.\.\ - +> Version checking only occurs with strong-named assemblies. + + The version number has four parts, as follows: + + \.\.\.\ + > [!IMPORTANT] -> All components of the version must be integers greater than or equal to 0. Metadata restricts the major, minor, build, and revision components for an assembly to a maximum value of - 1. If a component exceeds this value, a compilation error occurs. +> All components of the version must be integers greater than or equal to 0. Metadata restricts the major, minor, build, and revision components for an assembly to a maximum value of - 1. If a component exceeds this value, a compilation error occurs. - For example, `[assembly:AssemblyVersion("2.3.25.1")]` indicates 2 as the major version, 3 as the minor version, 25 as the build number, and 1 as the revision number. + For example, `[assembly:AssemblyVersion("2.3.25.1")]` indicates 2 as the major version, 3 as the minor version, 25 as the build number, and 1 as the revision number. -The attribute allows you to specify an asterisk (\*) in place of the build or revision number. A version number such as `[assembly:AssemblyVersion("1.2.*")]` specifies 1 as the major version and 2 as the minor version, and accepts the default build and revision numbers. A version number such as `[assembly:AssemblyVersion("1.2.15.*")]` specifies 1 as the major version, 2 as the minor version, and 15 as the build number, and accepts the default revision number. The default build number increments daily. The default revision number is the number of seconds since midnight local time (without taking into account time zone adjustments for daylight saving time), divided by 2. If you specify an asterisk for the build number, you can't specify a revision number. +The attribute allows you to specify an asterisk (\*) in place of the build or revision number. A version number such as `[assembly:AssemblyVersion("1.2.*")]` specifies 1 as the major version and 2 as the minor version, and accepts the default build and revision numbers. A version number such as `[assembly:AssemblyVersion("1.2.15.*")]` specifies 1 as the major version, 2 as the minor version, and 15 as the build number, and accepts the default revision number. The default build number increments daily. The default revision number is the number of seconds since midnight local time (without taking into account time zone adjustments for daylight saving time), divided by 2. If you specify an asterisk for the build number, you can't specify a revision number. -> [!IMPORTANT] +> [!IMPORTANT] > Use of the attribute that specifies an asterisk: > > - Makes the build outputs non-reproducible (see [Reproducible builds](https://reproducible-builds.org/)). If the project sets `Deterministic` build property to `true` an error `CS8357` is reported by the compiler. > - Might degrade build performance, as it prevents build from caching compiler outputs. > - Is incompatible with the [Edit & Continue](/visualstudio/debugger/edit-and-continue-visual-csharp) and [Hot Reload](/visualstudio/debugger/hot-reload) features. - + You can mitigate some of these issues by limiting the use of time-based versions to release builds using conditional compilation, like so: -``` +```csharp #if DEBUG [assembly: AssemblyVersion("1.0.0.0")] #else @@ -108,20 +108,20 @@ You can mitigate some of these issues by limiting the use of time-based versions A better approach to versioning is to derive the assembly or file version from the `HEAD` commit SHA (for git repositories). See, for example, [Nerdbank.GitVersioning](https://github.com/dotnet/Nerdbank.GitVersioning). - The assembly major and minor versions are used as the type library version number when the assembly is exported. Some COM hosts do not accept type libraries with the version number 0.0. Therefore, if you want to expose an assembly to COM clients, set the assembly version explicitly to 1.0 in the `AssemblyVersionAttribute` page for projects created outside Visual Studio 2005 and with no `AssemblyVersionAttribute` specified. Do this even when the assembly version is 0.0. All projects created in Visual Studio 2005 have a default assembly version of 1.0.*. - - To get the name of an assembly you have loaded, call on the assembly to get an , and then get the property. To get the name of an assembly you have not loaded, call from your client application to check the assembly version that your application uses. - - The attribute can only be applied once. Some Visual Studio project templates already include the attribute. In those projects, adding the attribute in code causes a compiler error. - - - -## Examples - The following example uses the attribute to assign a version number to an assembly. At compile time, this version information is stored with the assembly's metadata. At run time, the example retrieves the value of the property on a type found in the assembly to get a reference to the executing assembly, and it retrieves the assembly's version information from the property of the object returned by the method. - + The assembly major and minor versions are used as the type library version number when the assembly is exported. Some COM hosts do not accept type libraries with the version number 0.0. Therefore, if you want to expose an assembly to COM clients, set the assembly version explicitly to 1.0 in the `AssemblyVersionAttribute` page for projects created outside Visual Studio 2005 and with no `AssemblyVersionAttribute` specified. Do this even when the assembly version is 0.0. All projects created in Visual Studio 2005 have a default assembly version of 1.0.*. + + To get the name of an assembly you have loaded, call on the assembly to get an , and then get the property. To get the name of an assembly you have not loaded, call from your client application to check the assembly version that your application uses. + + The attribute can only be applied once. Some Visual Studio project templates already include the attribute. In those projects, adding the attribute in code causes a compiler error. + + + +## Examples + The following example uses the attribute to assign a version number to an assembly. At compile time, this version information is stored with the assembly's metadata. At run time, the example retrieves the value of the property on a type found in the assembly to get a reference to the executing assembly, and it retrieves the assembly's version information from the property of the object returned by the method. + :::code language="csharp" source="~/snippets/csharp/System/Version/Overview/example1.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.Version.Class/vb/example1.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.Version.Class/vb/example1.vb" id="Snippet6"::: + ]]> @@ -175,29 +175,29 @@ You can mitigate some of these issues by limiting the use of time-based versions The version number of the attributed assembly. Initializes a new instance of the class with the version number of the assembly being attributed. - Set assembly attributes diff --git a/xml/System.Reflection/EventInfo.xml b/xml/System.Reflection/EventInfo.xml index 020ac86d666..ef22c3ecd3e 100644 --- a/xml/System.Reflection/EventInfo.xml +++ b/xml/System.Reflection/EventInfo.xml @@ -575,7 +575,7 @@ Note: In method allows you to write code that assigns specific types to the type parameters of a generic method definition, thus creating a object that represents a particular constructed method. If the property of this object returns `true`, you can use it to invoke the method or to create a delegate to invoke the method. - Methods constructed with the method can be open, that is, some of their type arguments can be type parameters of enclosing generic types. You might use such open constructed methods when you generate dynamic assemblies. For example, consider the following C#, Visual Basic, and C++ code. + Methods constructed with the method can be open, that is, some of their type arguments can be type parameters of enclosing generic types. You might use such open constructed methods when you generate dynamic assemblies. For example, consider the following code. -``` +```csharp class C { T N(T t, U u) {...} @@ -1168,7 +1163,9 @@ class C return N(v, 42); } } +``` +```vb Class C Public Function N(Of T,U)(ByVal ta As T, ByVal ua As U) As T ... @@ -1177,17 +1174,6 @@ Class C Return N(Of V, Integer)(va, 42) End Function End Class - -ref class C -{ -private: - generic T N(T t, U u) {...} -public: - generic V M(V v) - { - return N(v, 42); - } -}; ``` The method body of `M` contains a call to method `N`, specifying the type parameter of `M` and the type . The property returns `false` for method `N`. The property returns `true`, so method `N` cannot be invoked. @@ -1199,17 +1185,12 @@ public: ## Examples The following code example demonstrates the properties and methods of that support the examination of generic methods. The example does the following: -- Defines a class that has a generic method. - -- Creates a that represents the generic method. - -- Displays properties of the generic method definition. - -- Assigns type arguments to the type parameters of the , and invokes the resulting constructed generic method. - -- Displays properties of the constructed generic method. - -- Retrieves the generic method definition from the constructed method and compares it to the original definition. +- Defines a class that has a generic method. +- Creates a that represents the generic method. +- Displays properties of the generic method definition. +- Assigns type arguments to the type parameters of the , and invokes the resulting constructed generic method. +- Displays properties of the constructed generic method. +- Retrieves the generic method definition from the constructed method and compares it to the original definition. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/MethodInfo.Generics/cpp/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/Type/DeclaringMethod/source.cs" id="Snippet1"::: diff --git a/xml/System.Runtime.CompilerServices/Unsafe.xml b/xml/System.Runtime.CompilerServices/Unsafe.xml index 7637a3a3238..c219ee8847c 100644 --- a/xml/System.Runtime.CompilerServices/Unsafe.xml +++ b/xml/System.Runtime.CompilerServices/Unsafe.xml @@ -62,7 +62,7 @@ Consider the following example, which reverses the elements within a `Span`. > [!NOTE] > These examples exist simply for demonstration purposes. In real-world applications, developers should instead use helper functions like , which are better optimized than even these examples. -```cs + ```csharp // A safe, verifiable way to reverse a Span. static void Reverse(Span span) { @@ -79,7 +79,7 @@ static void Reverse(Span span) This method is fully type-safe and the .NET runtime may insert bounds checks to help enforce safety. However, low-level library authors may want to suppress .NET's normal safety checks in order to improve the performance of their own code. Such developers would typically rely on static analysis tools or their own code reviews to help enforce correctness. The `Unsafe` APIs allow a developer to rewrite this code using unverifiable constructs, as the following example shows. -```cs + ```csharp // A correct but unverifiable way to reverse a Span. static void Reverse(Span span) { @@ -639,7 +639,7 @@ The behavior of `Unsafe.As(o)` is only well-defined if the typical "safe" cas To help enforce correct usage, developers might consider using a standard cast or a debug-only assert in their code, as shown in the following examples. -```cs + ```csharp void ReinterpretCastAndUse_Sample1(object o) { // Assume that we know through some other means that 'o' is a string, @@ -739,7 +739,7 @@ This API is conceptually similar to C++'s `reinterpret_cast<>`. It is the caller Only the managed pointer is reinterpreted. The referenced value itself will remain unchanged. Consider the following example. -```cs + ```csharp int[] intArray = new int[] { 0x1234_5678 }; // a 1-element array ref int refToInt32 = ref intArray[0]; // managed pointer to first Int32 in array ref short refToInt16 = ref Unsafe.As(ref refToInt32); // reinterpret as managed pointer to Int16 @@ -969,7 +969,7 @@ This API is conceptually similar to C++'s `const_cast<>`. It is the caller's res `AsRef` is typically used for passing a readonly reference into methods like , which accept mutable managed pointers as arguments. Consider the following example. -```cs + ```csharp int ComputeSumOfElements(ref int refToFirstElement, nint numElements) { int sum = 0; @@ -982,7 +982,7 @@ int ComputeSumOfElements(ref int refToFirstElement, nint numElements) If the input parameter is `ref readonly int refToFirstElement` instead of `ref int refToFirstElement`, the previous example will not compile, since readonly references cannot be used as arguments to `Add`. Instead, `AsRef` can be used to remove the immutability constraint and allow compilation to succeed, as shown in the following example. -```cs + ```csharp int ComputeSumOfElements(ref readonly int refToFirstElement, nint numElements) { int sum = 0; @@ -1212,7 +1212,7 @@ Both `destination` and `source` are assumed to be properly aligned for pointers This method is roughly equivalent to the following code. -```cs + ```csharp static void Copy(void* destination, ref T source) { T data = source; // dereference source @@ -1294,7 +1294,7 @@ Both `destination` and `source` are assumed to be properly aligned for pointers This method is roughly equivalent to the following code. -```cs + ```csharp static void Copy(ref T destination, void* source) { T data = *(T*)source; // reinterpret cast source as T* and dereference @@ -2376,7 +2376,7 @@ This API corresponds to the `sizeof` opcode. If `T` is a reference type, the ret This method is typically used to avoid double-initialization when initializing union-type structs. Consider the following example, which produces a C# compiler error. -```cs + ```csharp using System; using System.Runtime.InteropServices; @@ -2401,7 +2401,7 @@ This error occurs because the compiler expects _all_ fields of the struct to be One way to avoid this compiler error is to ensure the entire struct is zero-initialized before individual fields are set, as shown in the following example. -```cs + ```csharp // This sample compiles successfully. public static MyUnionStruct MyMethod() { MyUnionStruct value = default; // the struct is now guaranteed assigned @@ -2412,7 +2412,7 @@ public static MyUnionStruct MyMethod() { If you want to avoid the initial zero-initialization, you can call the `SkipInit` method can be used to suppress the compiler warning. -```cs + ```csharp using System.Runtime.CompilerServices; // This sample also compiles successfully. diff --git a/xml/System.Runtime.DurableInstancing/InstancePersistenceContext.xml b/xml/System.Runtime.DurableInstancing/InstancePersistenceContext.xml index 2eb307ab602..00a13e6140c 100644 --- a/xml/System.Runtime.DurableInstancing/InstancePersistenceContext.xml +++ b/xml/System.Runtime.DurableInstancing/InstancePersistenceContext.xml @@ -379,21 +379,24 @@ diff --git a/xml/System.Runtime.InteropServices.WindowsRuntime/ReturnValueNameAttribute.xml b/xml/System.Runtime.InteropServices.WindowsRuntime/ReturnValueNameAttribute.xml index 3cb61f51f1a..1b90bd744fb 100644 --- a/xml/System.Runtime.InteropServices.WindowsRuntime/ReturnValueNameAttribute.xml +++ b/xml/System.Runtime.InteropServices.WindowsRuntime/ReturnValueNameAttribute.xml @@ -52,7 +52,6 @@ Public Shared Function ComputeAverage( _ ByRef maxValue As Integer) As Integer … End Function - ``` When you call the function from JavaScript, you can access the return value by its default name (`value`): @@ -62,7 +61,6 @@ var data = [5, 13, 23, 37]; var results = SampleComponent.TestStuff.computeAverage(data); var formattedResults = "Min=" + results.minValue + ", Avg=" + results.value + ", Max=" + results.maxValue; - ``` You must give the return value a different name if you already have a parameter named "value". Or you might simply want to use a more meaningful name (such as "average" in this example). Apply the attribute to your method and specify a new name. @@ -74,7 +72,6 @@ public static int ComputeAverage([ReadOnlyArray()] int[] input, { … } - ``` ```vb @@ -85,7 +82,6 @@ Public Shared Function ComputeAverage( _ As Integer … End Function - ``` ]]> diff --git a/xml/System.Runtime.Serialization/DataContractSerializer.xml b/xml/System.Runtime.Serialization/DataContractSerializer.xml index c69a10b2ca7..da24458cd0c 100644 --- a/xml/System.Runtime.Serialization/DataContractSerializer.xml +++ b/xml/System.Runtime.Serialization/DataContractSerializer.xml @@ -1186,14 +1186,19 @@ ## Remarks This property can be set in configuration or imperatively in code. To set it in configuration, add a custom behavior to the behaviors section and add the following setting. -``` - +```xml + + + + + ``` - To set this property imperatively in code find the operation description of the service, then get the operation behavior, finally set the property as shown in the following code. + To set this property imperatively in code, find the operation description of the service, then get the operation behavior, and finally set the property as shown in the following code. -``` -OperationDescription operation = host.Description.Endpoints[0].Contract.Operations.Find("MyOperationName");operation.Behaviors.Find().MaxItemsInObjectGraph = 3; +```csharp +OperationDescription operation = host.Description.Endpoints[0].Contract.Operations.Find("MyOperationName"); +operation.Behaviors.Find().MaxItemsInObjectGraph = 3; ``` The property specifies the maximum number of objects that the serializer serializes or deserializes in a single method call. (The method always reads one root object, but this object may have other objects in its data members. Those objects may have other objects, and so on.) The default is . Note that when serializing or deserializing arrays, every array entry counts as a separate object. Also, note that some objects may have a large memory representation and so this quota alone may not be sufficient to prevent Denial of Service attacks. For more information, see [Security Considerations for Data](/dotnet/framework/wcf/feature-details/security-considerations-for-data). If you need to increase this quota beyond its default value, it is important to do so both on the sending (serializing) and receiving (deserializing) sides. It applies both when reading and writing data. diff --git a/xml/System.Security.Claims/Claim.xml b/xml/System.Security.Claims/Claim.xml index bf1e4051251..2044f7f3a56 100644 --- a/xml/System.Security.Claims/Claim.xml +++ b/xml/System.Security.Claims/Claim.xml @@ -91,7 +91,6 @@ if (null != principal) } } - ``` ]]> diff --git a/xml/System.Security.Claims/ClaimsAuthorizationManager.xml b/xml/System.Security.Claims/ClaimsAuthorizationManager.xml index 086e02908ef..a2bce789066 100644 --- a/xml/System.Security.Claims/ClaimsAuthorizationManager.xml +++ b/xml/System.Security.Claims/ClaimsAuthorizationManager.xml @@ -55,7 +55,7 @@ The policy used by the claims authorization manager is specified by custom `` elements under the [<claimsAuthorizationManager>](/dotnet/framework/configure-apps/file-schema/windows-identity-foundation/claimsauthorizationmanager) element. In the first policy, the principal must possess one of the specified claims in order to perform the specified action on the specified resource. In the second policy, the principal must possess both claims to be able to perform the specified action on the specified resource. In all others, the principal is automatically granted access regardless of the claims it possesses. -``` +```xml @@ -222,7 +222,7 @@ The policy used by the claims authorization manager is specified by custom `` elements under the [<claimsAuthorizationManager>](/dotnet/framework/configure-apps/file-schema/windows-identity-foundation/claimsauthorizationmanager) element. This policy is read and compiled by the method. In the first policy, the principal must possess one of the specified claims in order to perform the specified action on the specified resource. In the second policy, the principal must possess both claims to be able to perform the specified action on the specified resource. In all others, the principal is automatically granted access regardless of the claims it possesses. -``` +```xml @@ -304,7 +304,7 @@ The policy used by the claims authorization manager is specified by custom `` elements under the [<claimsAuthorizationManager>](/dotnet/framework/configure-apps/file-schema/windows-identity-foundation/claimsauthorizationmanager) element. This policy is read and compiled by the method. In the first policy, the principal must possess one of the specified claims in order to perform the specified action on the specified resource. In the second policy, the principal must possess both claims to be able to perform the specified action on the specified resource. In all others, the principal is automatically granted access regardless of the claims it possesses. -``` +```xml diff --git a/xml/System.Security.Cryptography.X509Certificates/X500DistinguishedNameBuilder.xml b/xml/System.Security.Cryptography.X509Certificates/X500DistinguishedNameBuilder.xml index 7c566c4ad04..fd0f6b18d46 100644 --- a/xml/System.Security.Cryptography.X509Certificates/X500DistinguishedNameBuilder.xml +++ b/xml/System.Security.Cryptography.X509Certificates/X500DistinguishedNameBuilder.xml @@ -31,7 +31,7 @@ When constructing the `SEQUENCE OF` `Relative Distinguished Names`, this builder constructs the `SEQUENCE OF` in the opposite order which they were added to the builder. For example: -```cs + ```csharp builder.AddCommonName("Contoso"); builder.AddCountryOrRegion("US"); ``` diff --git a/xml/System.Security.Cryptography.Xml/CipherReference.xml b/xml/System.Security.Cryptography.Xml/CipherReference.xml index 6d1def7537d..1f5273320a5 100644 --- a/xml/System.Security.Cryptography.Xml/CipherReference.xml +++ b/xml/System.Security.Cryptography.Xml/CipherReference.xml @@ -51,14 +51,12 @@ If you are sure the documents you are decrypting can be trusted, you can change this behavior for fully trusted applications by using the following code: -``` +```csharp Evidence ev = new Evidence(); ev.AddHost (new Zone(SecurityZone.MyComputer)); EncryptedXml exml = new EncryptedXml(doc, ev); ``` - - ## Examples The following code example creates a new instance of . diff --git a/xml/System.Security.Cryptography/RSA.xml b/xml/System.Security.Cryptography/RSA.xml index cf730ef32b1..9451164be13 100644 --- a/xml/System.Security.Cryptography/RSA.xml +++ b/xml/System.Security.Cryptography/RSA.xml @@ -2707,7 +2707,7 @@ An error occurred creating the signature. When you pass `true` to the method, the resulting XML string takes the following form: -``` +```xml @@ -2722,7 +2722,7 @@ An error occurred creating the signature. When you pass `false` to the method, the resulting XML string takes the following form: -``` +```xml diff --git a/xml/System.Security.Principal/WindowsIdentity.xml b/xml/System.Security.Principal/WindowsIdentity.xml index 4fe8747ff44..a9dd49ec001 100644 --- a/xml/System.Security.Principal/WindowsIdentity.xml +++ b/xml/System.Security.Principal/WindowsIdentity.xml @@ -1988,7 +1988,6 @@ public class ImpersonationDemo Console.WriteLine("After impersonation: " + WindowsIdentity.GetCurrent().Name); } } - ``` ]]> @@ -2133,7 +2132,6 @@ public class ImpersonationDemo Console.WriteLine("After impersonation: " + WindowsIdentity.GetCurrent().Name); } } - ``` ]]> diff --git a/xml/System.Threading.Tasks/Task.xml b/xml/System.Threading.Tasks/Task.xml index 025d77e125d..b8812b8ed90 100644 --- a/xml/System.Threading.Tasks/Task.xml +++ b/xml/System.Threading.Tasks/Task.xml @@ -1099,13 +1099,10 @@ When an asynchronous method awaits a directly ## Remarks The returned will not be scheduled for execution until the current task has completed. If the continuation criteria specified through the `continuationOptions` parameter are not met, the continuation task will be canceled instead of scheduled. - - ## Examples The following example demonstrates using to specify that a continuation task should run synchronously when the antecedent task completes. (If the specified task has already completed by the time is called, the synchronous continuation will run on the thread calling .) ```csharp - public class TaskCounter { private volatile int _count; @@ -1119,11 +1116,9 @@ public class TaskCounter public int NumberOfActiveTasks { get { return _count; } } } - ``` ```vb - Public Class TaskCounter Private _count as Integer @@ -1142,7 +1137,6 @@ Public Class TaskCounter End Get End Property End Class - ``` ]]> @@ -1502,7 +1496,6 @@ End Class The following is an example of using ContinueWith to run work both in the background and on the user interface threads. ```csharp - private void Button1_Click(object sender, EventArgs e) { var backgroundScheduler = TaskScheduler.Default; @@ -1514,11 +1507,9 @@ private void Button1_Click(object sender, EventArgs e) backgroundScheduler). ContinueWith(delegate { UpdateUIAgain(); }, uiScheduler); } - ``` ```vb - Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim backgroundScheduler = TaskScheduler.Default @@ -1534,7 +1525,6 @@ Private Sub Button1_Click(ByVal sender As System.Object, UpdateUIAgain() End Sub, uiScheduler) End Sub - ``` ]]> @@ -2824,7 +2814,7 @@ End Sub Note that this example includes a potential race condition: it depends on the task asynchronously executing the delay when the token is cancelled. Although the 1.5 second delay from the call to the method makes that assumption likely, it is nevertheless possible that the call to the method could return before the token is cancelled. In that case, the example produces the following output: -``` +```txt Task t Status: RanToCompletion, Result: 42 ``` diff --git a/xml/System.Threading/SemaphoreSlim.xml b/xml/System.Threading/SemaphoreSlim.xml index 9e103d51335..0ea58881bda 100644 --- a/xml/System.Threading/SemaphoreSlim.xml +++ b/xml/System.Threading/SemaphoreSlim.xml @@ -75,14 +75,12 @@ The basic structure for code that uses a semaphore to protect resources is: ```vb - ' Enter semaphore by calling one of the Wait or WaitAsync methods. SemaphoreSlim.Wait() ' ' Execute code protected by the semaphore. ' SemaphoreSlim.Release() - ``` When all threads have released the semaphore, the count is at the maximum value specified when the semaphore was created. The semaphore's count is available from the property. @@ -90,8 +88,6 @@ SemaphoreSlim.Release() > [!IMPORTANT] > The class doesn't enforce thread or task identity on calls to the , , and methods. In addition, if the constructor is used to instantiate the object, the property can increase beyond the value set by the constructor. It is the programmer's responsibility to ensure that calls to or methods are appropriately paired with calls to methods. - - ## Examples The following example creates a semaphore with a maximum count of three threads and an initial count of zero threads. The example starts five tasks, all of which block waiting for the semaphore. The main thread calls the overload to increase the semaphore count to its maximum, which allows three tasks to enter the semaphore. Each time the semaphore is released, the previous semaphore count is displayed. Console messages track semaphore use. The simulated work interval is increased slightly for each thread to make the output easier to read. From 75d09224d1395f6fb0a5ce3d959a056caf44f527 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Thu, 24 Apr 2025 07:50:56 -0700 Subject: [PATCH 16/16] Fix format tag warnings (#11235) --- xml/System.Globalization/CompareInfo.xml | 23 +++++++++++++------ .../CultureAndRegionInfoBuilder.xml | 21 ++++++++++++----- xml/System.Globalization/CultureInfo.xml | 23 +++++++++++++------ xml/System.Globalization/RegionInfo.xml | 23 +++++++++++++------ xml/System.Globalization/SortVersion.xml | 21 ++++++++++++----- 5 files changed, 78 insertions(+), 33 deletions(-) diff --git a/xml/System.Globalization/CompareInfo.xml b/xml/System.Globalization/CompareInfo.xml index 943d1788058..8437963362c 100644 --- a/xml/System.Globalization/CompareInfo.xml +++ b/xml/System.Globalization/CompareInfo.xml @@ -86,14 +86,23 @@ Implements a set of methods for culture-sensitive string comparisons. - For more information about this API, see Supplemental API remarks for CompareInfo. - - The following example shows how the object associated with a object affects string comparison. + + + ## Remarks + + For more information about this API, see [Supplemental API remarks for CompareInfo](/dotnet/fundamentals/runtime-libraries/system-globalization-compareinfo). + + ## Example + + The following example shows how the object associated with a object affects string comparison. + + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/CompareInfo/cpp/CompareInfo.cpp" id="Snippet1"::: + :::code language="csharp" source="~/snippets/csharp/System.Globalization/CompareInfo/Overview/CompareInfo.cs" id="Snippet1"::: + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/CompareInfo/VB/CompareInfo.vb" id="Snippet1"::: + + ]]> + Sorting Weight Tables for Windows operating systems Default Unicode Collation Element Table, for Linux and macOS diff --git a/xml/System.Globalization/CultureAndRegionInfoBuilder.xml b/xml/System.Globalization/CultureAndRegionInfoBuilder.xml index 1d44f75ff61..6866c6cb222 100644 --- a/xml/System.Globalization/CultureAndRegionInfoBuilder.xml +++ b/xml/System.Globalization/CultureAndRegionInfoBuilder.xml @@ -22,13 +22,22 @@ Defines a custom culture that is new or based on another culture and country/region. The custom culture can be installed on a computer and subsequently used by any application that is running on that computer. This class cannot be inherited. - For more information about this API, see Supplemental API remarks for CultureAndRegionInfoBuilder. - - The following example defines a custom ru-US culture that represents the Russian language in the United States. The example defines the custom culture by loading settings from the Russian (Russia) object and the U.S. object, and then sets a number of properties. The example registers the custom culture, and then instantiates it and makes it the current culture. + + + ## Remarks + + For more information about this API, see [Supplemental API remarks for CultureAndRegionInfoBuilder](/dotnet/fundamentals/runtime-libraries/system-globalization-cultureandregioninfobuilder). + + ## Example + + The following example defines a custom ru-US culture that represents the Russian language in the United States. The example defines the custom culture by loading settings from the Russian (Russia) object and the U.S. object, and then sets a number of properties. The example registers the custom culture, and then instantiates it and makes it the current culture. + + :::code language="csharp" source="~/snippets/csharp/System.Globalization/CultureAndRegionInfoBuilder/Overview/car.cs" id="Snippet1"::: + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.globalization.cultureandregioninfobuilder.class/vb/car.vb" id="Snippet1"::: + + ]]> + diff --git a/xml/System.Globalization/CultureInfo.xml b/xml/System.Globalization/CultureInfo.xml index 5b572fc1719..8ea383ecf9b 100644 --- a/xml/System.Globalization/CultureInfo.xml +++ b/xml/System.Globalization/CultureInfo.xml @@ -86,14 +86,23 @@ Provides information about a specific culture (called a *locale* for unmanaged code development). The information includes the names for the culture, the writing system, the calendar used, the sort order of strings, and formatting for dates and numbers. - For more information about this API, see Supplemental API remarks for CultureInfo. - - The following example shows how to create a object for Spanish (Spain) with the international sort and another object with the traditional sort. + + + ## Remarks + + For more information about this API, see [Supplemental API remarks for CultureInfo](/dotnet/fundamentals/runtime-libraries/system-globalization-cultureinfo). + + ## Example + + The following example shows how to create a object for Spanish (Spain) with the international sort and another object with the traditional sort. + + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.Globalization.CultureInfo_esES/CPP/spanishspain.cpp" id="Snippet1"::: + :::code language="csharp" source="~/snippets/csharp/System.Globalization/CultureInfo/Overview/spanishspain.cs" id="Snippet1"::: + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.Globalization.CultureInfo_esES/VB/spanishspain.vb" id="Snippet1"::: + + ]]> + diff --git a/xml/System.Globalization/RegionInfo.xml b/xml/System.Globalization/RegionInfo.xml index 55139b85b49..4d62e2d4341 100644 --- a/xml/System.Globalization/RegionInfo.xml +++ b/xml/System.Globalization/RegionInfo.xml @@ -73,14 +73,23 @@ Contains information about the country/region. - For more information about this API, see Supplemental API remarks for RegionInfo. - - The following example demonstrates several members of the class. + + + ## Remarks + + For more information about this API, see [Supplemental API remarks for RegionInfo](/dotnet/fundamentals/runtime-libraries/system-globalization-regioninfo). + + ## Example + + The following example demonstrates several members of the class. + + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.Globalization.RegionInfo/CPP/regioninfo.cpp" id="Snippet1"::: + :::code language="csharp" source="~/snippets/csharp/System.Globalization/RegionInfo/Overview/regioninfo.cs" interactive="try-dotnet" id="Snippet1"::: + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.Globalization.RegionInfo/VB/regioninfo.vb" id="Snippet1"::: + + ]]> + diff --git a/xml/System.Globalization/SortVersion.xml b/xml/System.Globalization/SortVersion.xml index 691c97200ee..578012e2e1e 100644 --- a/xml/System.Globalization/SortVersion.xml +++ b/xml/System.Globalization/SortVersion.xml @@ -56,13 +56,22 @@ Provides information about the version of Unicode used to compare and order strings. - For more information about this API, see Supplemental API remarks for SortVersion. - - The following example contains a portion of the source code from an application that uses the class to ensure that the native names of objects are ordered appropriately for the current system and current culture. It uses the and objects to store and retrieve ordered data from a data file named `Regions.dat` rather than retrieving and ordering data each time the application is run. The example first checks to determine whether the data file exists. If it does not, it creates the data and sets the `reindex` flag, which indicates that the data must be resorted and saved again. Otherwise, it retrieves the data and compares the saved object with the object for the current culture on the current system. If they are not equal, or if the `reindex` flag had been set previously, it resorts to the data. + + + ## Remarks + + For more information about this API, see [Supplemental API remarks for SortVersion](/dotnet/fundamentals/runtime-libraries/system-globalization-sortversion). + + ## Example + + The following example contains a portion of the source code from an application that uses the class to ensure that the native names of objects are ordered appropriately for the current system and current culture. It uses the and objects to store and retrieve ordered data from a data file named `Regions.dat` rather than retrieving and ordering data each time the application is run. The example first checks to determine whether the data file exists. If it does not, it creates the data and sets the `reindex` flag, which indicates that the data must be resorted and saved again. Otherwise, it retrieves the data and compares the saved object with the object for the current culture on the current system. If they aren't equal, or if the `reindex` flag had been set previously, it resorts to the data. + + :::code language="csharp" source="~/snippets/csharp/System.Globalization/SortVersion/Overview/example1.cs" id="Snippet1"::: + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.globalization.sortversion/vb/example1.vb" id="Snippet1"::: + + ]]> +