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
Prefer use of interpolated strings in PresentationUI and ReachFramework #8739
base: main
Are you sure you want to change the base?
Conversation
d6cb976
to
999cfa6
Compare
999cfa6
to
22c1e96
Compare
src/Microsoft.DotNet.Wpf/src/PresentationUI/MS/Internal/Documents/Application/DocumentStream.cs
Show resolved
Hide resolved
sigStatus.ToString(), | ||
height, | ||
width); | ||
string resourceName = $@"{sigStatus}_{height}x{width}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing InvariantCulture here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the winforms repo, when doing such refactorings, a choice was made to ignore the invariant culture for int. I am no specialist but apparently it has no impact on integer formatting. I can put it back just for peace of mind
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, as long as there is no format requested, the culture is not used (other than for negative sign, which shouldn't be an issue for width/height).
Follow-up to #8519
Description
We replace as many manual string concatenations and string.Format with interpolated strings. This saves allocations in many instances, and makes for a more readable code.
Customer Impact
Less allocations
Regression
No
Testing
CI
Risk
Low. Most changes are automated using the IDE
Microsoft Reviewers: Open in CodeFlow