Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sample.cs #8740

Merged
merged 1 commit into from
Jun 5, 2024
Merged

Update sample.cs #8740

merged 1 commit into from
Jun 5, 2024

Conversation

zacharylayne
Copy link
Contributor

@zacharylayne zacharylayne commented Dec 27, 2022

Summary

Minor cleanup:

  • In Handle setter, removed else.
  • In both the constructor and Load method, renamed Path to path.
  • Deleted comment in setter explaining how if the handle is valid, return the handle value.
  • Removed brackets for if-statements with 1 line.
  • Changed constructor to be expression-bodied.
  • Deleted some unnecessary empty lines.

There's a good amount more that could change for this example.

If approved, I'll apply these changes to the snippet for SafeWaitHandle too.

Minor cleanup:
  * In `Handle` setter, remove `else`.
  * In both the constructor and `Load` method, rename `Path` to `path`.
  * Deleted comment in setter explaining how if the handle is valid, return the handle value.
  * Got rid of brackets for if-statements with 1 line.
  * Changed constructor to be expression-bodied.
  * Deleted some unnecessary empty lines.

There's a good amount that could change for this example.

One more thing:
I came here to fix an error in the `Load` method as it appears in [MSDN](https://learn.microsoft.com/en-us/dotnet/api/microsoft.win32.safehandles.safefilehandle?view=net-7.0) (`&&` should be `||`). That is actually fixed here but the change hasn't been reflected in the site. Does something need to be triggered for this to happen?
@zacharylayne zacharylayne requested a review from a team as a code owner December 27, 2022 09:31
@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Dec 27, 2022
@dnfadmin
Copy link

dnfadmin commented Dec 27, 2022

CLA assistant check
All CLA requirements met.

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@learn-build-service-prod
Copy link

Learn Build status updates of commit 3c8005e:

✅ Validation status: passed

File Status Preview URL Details
snippets/csharp/Microsoft.Win32.SafeHandles/SafeFileHandle/Overview/sample.cs ✅Succeeded View

For more details, please refer to the build report.

Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.

For any questions, please:

Copy link
Contributor

@gewarren gewarren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @zacharylayne

@gewarren gewarren closed this Jun 5, 2024
@gewarren gewarren reopened this Jun 5, 2024
Copy link

Learn Build status updates of commit 3c8005e:

✅ Validation status: passed

File Status Preview URL Details
snippets/csharp/Microsoft.Win32.SafeHandles/SafeFileHandle/Overview/sample.cs ✅Succeeded View

For more details, please refer to the build report.

For any questions, please:

@gewarren gewarren merged commit 885dc23 into dotnet:main Jun 5, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Microsoft.Win32 community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants