From de086626e658ef39554cc6bb476f4d5d6dafed14 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Tue, 22 Apr 2025 16:53:18 -0700 Subject: [PATCH] add language slugs --- .../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; ``` ]]>