Clarify documentation about DataReceivedEventHandler and DataReceivedEventArgs.Data
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- csharp
- Domain
- documentation
Research direction
Start in xml/System.Diagnostics/DataReceivedEventArgs.xml and review the examples and notes for DataReceivedEventArgs.Data, DataReceivedEventHandler, and Process.OutputDataReceived. Update the documentation to distinguish null end-of-stream data from valid empty strings, with consistent examples and an explicit warning about String.IsNullOrEmpty().
Written by the indexing model from the issue text.
Description
Type of issue
Typo
Description
The documentation for DataReceivedEventArgs.Data states that an event with Data=null means that the stream has been closed. However, all the examples for DataReceivedEventHandler, DataReceivedEventArgs.Data and Process.OutputDataReceived are using String.IsNullOrEmpty() to check for null data, which is incorrect because it loses perfectly valid empty strings that correspond to empty lines in the program's output.
Also, the documentation for Process.OutputDataReceived doesn't say anything about null data or empty strings; I'd recommend to add a short note there too.
I'm proposing something like this for the examples, plus an explicit note saying "don't use IsNullOrEmpty(), it's incorrect":
if (e.Data == null) {
// end of stream
return;
}
// e.Data could be empty ("")
Console.WriteLine(e.Data);
Page URL
Content source URL
https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.Diagnostics/DataReceivedEventArgs.xml
Document Version Independent Id
4dcc73b2-f80f-8645-e8a6-c07b922ad5e1
Platform Id
e0f0476d-88bd-231d-79cb-986db6c3d434
Article author
@dotnet-bot
- Dominant language
- C#
- Stars
- 950
- Forks
- 1.7k
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 38
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/dotnet-api-docs
-
untriaged
Difficulty 1/5 Under an hour Newbie friendliness 88/100
dotnet/dotnet-api-docs#13039 · 1 comment ·
-
DisplayAttribute string properties: Remarks incorrectly state the property performs resource lookup Openarea-System.ComponentModel.DataAnnotations untriaged
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
dotnet/dotnet-api-docs#13023 · 1 comment ·
-
area-System.Net.Sockets untriaged
Difficulty 1/5 Under an hour Newbie friendliness 88/100
dotnet/dotnet-api-docs#13022 · 1 comment ·
-
area-System.Runtime untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dotnet/dotnet-api-docs#13015 · 1 comment ·
-
area-System.Runtime.InteropServices untriaged
Difficulty 1/5 Under an hour Newbie friendliness 84/100
dotnet/dotnet-api-docs#12959 ·
All issues in dotnet/dotnet-api-docs
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·