Skip to content

Commit e7e005b

Browse files
authored
Remove .NET Framework remarks (System.Diagnostics) (#12644)
1 parent b79c8ec commit e7e005b

42 files changed

Lines changed: 262 additions & 1180 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

xml/System.Diagnostics.Contracts/Contract.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@
409409
## Remarks
410410
The event information for this event is supplied by the <xref:System.Diagnostics.Contracts.ContractFailedEventArgs?displayProperty=nameWithType> object that is passed to the event handler. This event notifies a managed application environment such as an interactive interpreter or a Web browser host that a contract has failed. Before doing so, it will raise an event that an application can handle as it sees fit. For example, if code is being run in a testing framework, you can log a test failure and then end the test.
411411
412-
The default implementation of the <xref:System.Diagnostics.Contracts.Internal.ContractHelper.RaiseContractFailedEvent*> method in the .NET Framework class library is to call each handler that is registered with the <xref:System.Diagnostics.Contracts.Contract.ContractFailed> event. Exceptions thrown by handlers are ignored, but each handler can indicate whether the failure is handled by calling the <xref:System.Diagnostics.Contracts.ContractFailedEventArgs.SetHandled*> method for the event arguments. If any handler sets the failure as handled, the method returns `null` and no further action is taken. Alternatively, handlers can call the <xref:System.Diagnostics.Contracts.ContractFailedEventArgs.SetUnwind*> method to instruct the code to unwind. In that case, an exception is thrown after all handlers have executed.
412+
The default implementation of the <xref:System.Diagnostics.Contracts.Internal.ContractHelper.RaiseContractFailedEvent*> method is to call each handler that is registered with the <xref:System.Diagnostics.Contracts.Contract.ContractFailed> event. Exceptions thrown by handlers are ignored, but each handler can indicate whether the failure is handled by calling the <xref:System.Diagnostics.Contracts.ContractFailedEventArgs.SetHandled*> method for the event arguments. If any handler sets the failure as handled, the method returns `null` and no further action is taken. Alternatively, handlers can call the <xref:System.Diagnostics.Contracts.ContractFailedEventArgs.SetUnwind*> method to instruct the code to unwind. In that case, an exception is thrown after all handlers have executed.
413413
414414
]]></format>
415415
</remarks>

xml/System.Diagnostics.Contracts/ContractFailedEventArgs.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<format type="text/markdown"><![CDATA[
5454
5555
## Remarks
56-
A <xref:System.Diagnostics.Contracts.ContractFailedEventArgs> object is passed to the <xref:System.Diagnostics.Contracts.Contract.ContractFailed?displayProperty=nameWithType> event when a contract fails. The <xref:System.Diagnostics.Contracts.Contract.ContractFailed> event enables a managed application environment such as an interactive interpreter, a Web browser host, a test harness, or a logging infrastructure to be notified of contract failures. The event requires full trust.
56+
A <xref:System.Diagnostics.Contracts.ContractFailedEventArgs> object is passed to the <xref:System.Diagnostics.Contracts.Contract.ContractFailed?displayProperty=nameWithType> event when a contract fails. The <xref:System.Diagnostics.Contracts.Contract.ContractFailed> event enables a managed application environment such as an interactive interpreter, a Web browser host, a test harness, or a logging infrastructure to be notified of contract failures.
5757
5858
]]></format>
5959
</remarks>

xml/System.Diagnostics.PerformanceData/CounterData.xml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,14 +255,9 @@
255255
## Remarks
256256
This property provides safe access to the counter data for multi-threaded applications. If performance is of primary concern, use the <xref:System.Diagnostics.PerformanceData.CounterData.RawValue> property; however, the <xref:System.Diagnostics.PerformanceData.CounterData.RawValue> property is not thread safe.
257257
258-
Note that the <xref:System.Diagnostics.PerformanceData.CounterData.Value> property is not thread safe in .NET Framework 3.5.
259-
260258
To increment the counter value, consider using the <xref:System.Diagnostics.PerformanceData.CounterData.Increment*> or <xref:System.Diagnostics.PerformanceData.CounterData.IncrementBy*> method.
261259
262-
263-
264-
## Examples
265-
For an example, see <xref:System.Diagnostics.PerformanceData>.
260+
For an example, see <xref:System.Diagnostics.PerformanceData>.
266261
267262
]]></format>
268263
</remarks>

xml/System.Diagnostics.Tracing/EventListener.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,16 @@
6161
<format type="text/markdown"><![CDATA[
6262
6363
## Remarks
64-
An event listener represents the target for all events generated by event source (<xref:System.Diagnostics.Tracing.EventSource> object) implementations in the current application domain. When a new event listener is created, it is logically attached to all event sources in that application domain.
64+
An event listener represents the target for all events generated by event source (<xref:System.Diagnostics.Tracing.EventSource> object) implementations. When a new event listener is created, it is logically attached to all event sources.
6565
6666
> [!NOTE]
67-
> This type implements the <xref:System.IDisposable> interface. When you have finished using the type, you must dispose of it either directly or indirectly. To dispose of the type directly, call its <xref:System.IDisposable.Dispose*> method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the <xref:System.IDisposable> interface topic.
67+
> This type implements the <xref:System.IDisposable> interface. When you have finished using the type, you must dispose of it either directly or indirectly. To dispose of the type directly, call its <xref:System.IDisposable.Dispose*> method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` in C#.
6868
6969
An event listener can enable or disable on a per-current event source basis by using event levels (<xref:System.Diagnostics.Tracing.EventLevel>) and event keywords (<xref:System.Diagnostics.Tracing.EventKeywords>) to further restrict the set of events to be sent to the listener. The listener can also send arbitrary commands to a specific current event source by using the <xref:System.Diagnostics.Tracing.EventSource.SendCommand*> method. The meanings of the commands are specific to the implementation of the event source.
7070
71-
Multiple event listeners can be defined in a single application domain. Each listener is logically independent of the other listeners so that events that are enabled or disabled by one listener affect only that listener. It is possible for commands sent with the <xref:System.Diagnostics.Tracing.EventSource.SendCommand*> method to do a semantic operation (such as a garbage collection or flushing data) that affects the other listeners, but this is the exception rather than the rule.
71+
Multiple event listeners can be defined. Each listener is logically independent of the other listeners so that events that are enabled or disabled by one listener affect only that listener. It is possible for commands sent with the <xref:System.Diagnostics.Tracing.EventSource.SendCommand*> method to do a semantic operation (such as a garbage collection or flushing data) that affects the other listeners, but this is the exception rather than the rule.
7272
73-
Each event source keeps a list of event listeners that it sends events to. A set of filtering criteria is associated with each event source-listener pair. These criteria determine the events that listener will receive for the current event source. Listeners receive the events on their <xref:System.Diagnostics.Tracing.EventListener.OnEventWritten*> method. Therefore, subclasses of <xref:System.Diagnostics.Tracing.EventListener> must override this method to do something useful with the data.
73+
Each event source keeps a list of event listeners that it sends events to. A set of filtering criteria is associated with each event source-listener pair. These criteria determine the events that listener will receive for the current event source. Listeners receive the events on their <xref:System.Diagnostics.Tracing.EventListener.OnEventWritten*> method. Therefore, subclasses of <xref:System.Diagnostics.Tracing.EventListener> must override this method to do something useful with the data.
7474
7575
When a new event source is created, the <xref:System.Diagnostics.Tracing.EventListener.OnEventSourceCreated*> method is called. Every current event listener gets exactly one <xref:System.Diagnostics.Tracing.EventListener.OnEventSourceCreated*> call for every current event source that can send it log messages. When an event listener is created, a series of <xref:System.Diagnostics.Tracing.EventListener.OnEventSourceCreated*> calls are made to notify the new listener of all the event sources that existed before the listener was created.
7676
@@ -489,7 +489,7 @@
489489
<format type="text/markdown"><![CDATA[
490490
491491
## Remarks
492-
The value returned by <xref:System.Diagnostics.Tracing.EventListener.EventSourceIndex*> identifies an event source that is suitable for indexing an array. This integer is unique within the application domain. An event listener might find it useful to store additional information about each event source that is connected to it. The value returned by <xref:System.Diagnostics.Tracing.EventListener.EventSourceIndex*> allows this extra information to be efficiently stored in an expandable array such as `List<T>`.
492+
The value returned by <xref:System.Diagnostics.Tracing.EventListener.EventSourceIndex*> identifies an event source that is suitable for indexing an array. An event listener might find it useful to store additional information about each event source that is connected to it. The value returned by <xref:System.Diagnostics.Tracing.EventListener.EventSourceIndex*> allows this extra information to be efficiently stored in an expandable array such as `List<T>`.
493493
494494
]]></format>
495495
</remarks>

xml/System.Diagnostics.Tracing/EventWrittenEventArgs.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@
469469
<ReturnType>System.Int64</ReturnType>
470470
</ReturnValue>
471471
<Docs>
472-
<summary>Gets the thread identifier for the OS thread that wrote the event. (.NET Core 2.2 and later only.)</summary>
472+
<summary>Gets the thread identifier for the OS thread that wrote the event.</summary>
473473
<value>The thread identifier for the OS thread that wrote the event.</value>
474474
<remarks>To be added.</remarks>
475475
</Docs>
@@ -723,7 +723,7 @@
723723
<ReturnType>System.DateTime</ReturnType>
724724
</ReturnValue>
725725
<Docs>
726-
<summary>Gets the time that the event was originally generated as a <see cref="T:System.DateTime" /> timestamp. (.NET Core 2.2 and later only.)</summary>
726+
<summary>Gets the time that the event was originally generated as a <see cref="T:System.DateTime" /> timestamp.</summary>
727727
<value>The date and time when the event was logged. The system tries to be as precise as possible. </value>
728728
<remarks>To be added.</remarks>
729729
</Docs>

xml/System.Diagnostics/BooleanSwitch.xml

Lines changed: 6 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -64,40 +64,17 @@
6464
6565
You can create a <xref:System.Diagnostics.BooleanSwitch> in your code and set the <xref:System.Diagnostics.BooleanSwitch.Enabled> property directly to instrument a specific section of code.
6666
67-
For .NET Framework apps only, you can also enable or disable a <xref:System.Diagnostics.BooleanSwitch> through the application configuration file and then use the configured <xref:System.Diagnostics.BooleanSwitch> value in your application. To configure a <xref:System.Diagnostics.BooleanSwitch>, edit the configuration file that corresponds to the name of your application. Within this file, you can add or remove a switch, set a switch's value, or clear all the switches previously set by the application. The configuration file should be formatted like the following example.
67+
The <xref:System.Diagnostics.BooleanSwitch.Enabled> property of the new switch is set to `false` by default.
6868
69-
```xml
70-
<configuration>
71-
<system.diagnostics>
72-
<switches>
73-
<add name="mySwitch" value="1"/>
74-
</switches>
75-
</system.diagnostics>
76-
</configuration>
77-
```
78-
79-
This example configuration section defines a <xref:System.Diagnostics.BooleanSwitch> with the <xref:System.Diagnostics.Switch.DisplayName> property set to `mySwitch` and the <xref:System.Diagnostics.BooleanSwitch.Enabled*> value set to `true`. Within your .NET Framework application, you can use the configured switch value by creating a <xref:System.Diagnostics.BooleanSwitch> with the same name, as shown in the following code example.
80-
81-
:::code language="csharp" source="~/snippets/csharp/System.Diagnostics/BooleanSwitch/Overview/remarks.cs" id="Snippet2":::
82-
:::code language="vb" source="~/snippets/visualbasic/System.Diagnostics/BooleanSwitch/Overview/remarks.vb" id="Snippet2":::
83-
84-
For .NET Core and .NET 5+ apps, the <xref:System.Diagnostics.BooleanSwitch.Enabled> property of the new switch is set to `false` by default.
85-
86-
For .NET Framework apps, the <xref:System.Diagnostics.BooleanSwitch.Enabled> property is set using the value specified in the configuration file. Configure the switch with a value of 0 to set the <xref:System.Diagnostics.BooleanSwitch.Enabled> property to `false`; configure the switch with a nonzero value to set the <xref:System.Diagnostics.BooleanSwitch.Enabled> property to `true`. If the <xref:System.Diagnostics.BooleanSwitch> constructor cannot find initial switch settings in the configuration file, the <xref:System.Diagnostics.BooleanSwitch.Enabled> property of the new switch is set to `false`.
87-
88-
You must enable tracing or debugging to use a switch. The following syntax is compiler specific. If you use compilers other than C# or Visual Basic, refer to the documentation for your compiler.
89-
90-
- To enable debugging in C#, add the `/d:DEBUG` flag to the compiler command line when you compile your code, or you can add `#define DEBUG` to the top of your file. In Visual Basic, add the `/d:DEBUG=True` flag to the compiler command line.
91-
92-
- To enable tracing in C#, add the `/d:TRACE` flag to the compiler command line when you compile your code, or add `#define TRACE` to the top of your file. In Visual Basic, add the `/d:TRACE=True` flag to the compiler command line.
69+
You must enable tracing or debugging to use a switch.
9370
9471
> [!NOTE]
95-
> These debug and trace compiler switches are not required when using the <xref:System.Diagnostics.BooleanSwitch> class in isolation. They are only required in conjunction with <xref:System.Diagnostics.Trace> or <xref:System.Diagnostics.Debug> methods that are conditionally compiled.
72+
> These debug and trace compiler switches are not required when using the <xref:System.Diagnostics.BooleanSwitch> class in isolation. They are only required in conjunction with <xref:System.Diagnostics.Trace> or <xref:System.Diagnostics.Debug> methods that are conditionally compiled.
9673
97-
For more information on instrumenting your application, see <xref:System.Diagnostics.Debug> and <xref:System.Diagnostics.Trace>. For more information about configuring and using trace switches, see [Trace Switches](/dotnet/framework/debug-trace-profile/trace-switches).
74+
For more information on instrumenting your application, see <xref:System.Diagnostics.Debug> and <xref:System.Diagnostics.Trace>
9875
9976
> [!NOTE]
100-
> To improve performance, you can make <xref:System.Diagnostics.BooleanSwitch> members `static` in your class.
77+
> To improve performance, you can make <xref:System.Diagnostics.BooleanSwitch> members `static` in your class.
10178
10279
## Examples
10380
The following example creates a <xref:System.Diagnostics.BooleanSwitch> and uses the switch to determine whether to print an error message. You create the switch at the class level. The `Main` method passes its location to `MyMethod`, which prints an error message and where the error occurred.
@@ -177,25 +154,7 @@ For .NET Framework apps, the <xref:System.Diagnostics.BooleanSwitch.Enabled> pro
177154
<format type="text/markdown"><![CDATA[
178155
179156
## Remarks
180-
When you create a <xref:System.Diagnostics.BooleanSwitch>, the `displayName` parameter is used to find the initial switch settings for .NET Framework apps in the application configuration file. If the constructor cannot find initial settings, or for .NET Core and .NET 5+ apps, the <xref:System.Diagnostics.BooleanSwitch.Enabled> property is set to `false` (disabled).
181-
182-
To set the level of your <xref:System.Diagnostics.BooleanSwitch> in a .NET Framework app, edit the configuration file corresponding to the name of your application. Within this file, you can add a switch and set its value, remove a switch, or clear all switches previously set by the application. The configuration file should be formatted like the following example:
183-
184-
```xml
185-
<configuration>
186-
<system.diagnostics>
187-
<switches>
188-
<add name="mySwitch" value="10" />
189-
<add name="myNewSwitch" value="20" />
190-
<remove name="mySwitch" />
191-
<clear/>
192-
</switches>
193-
</system.diagnostics>
194-
</configuration>
195-
```
196-
197-
> [!NOTE]
198-
> The switches you created should be `static`.
157+
When you create a <xref:System.Diagnostics.BooleanSwitch>, the <xref:System.Diagnostics.BooleanSwitch.Enabled> property is set to `false` (disabled).
199158
200159
## Examples
201160
The following example creates a <xref:System.Diagnostics.BooleanSwitch> and uses the switch to determine whether to print an error message. The switch is created at the class level. The `Main` method passes its location to `MyMethod`, which prints an error message and where the error occurred.

0 commit comments

Comments
 (0)