Modernize C# snippets - #13052
Open
gewarren wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The modernization preserves sample behavior, with only two non-blocking spelling corrections identified.
Pull request overview
Modernizes System.Drawing C# snippets for .NET 10 while preserving their documented APIs.
Changes:
- Normalizes formatting and adopts modern C# syntax.
- Consolidates Bitmap constructor samples into one executable project.
- Renames duplicate form types and entry points.
File summaries
| File | Description |
|---|---|
ToolboxBitmapAttribute/Overview/usercontrol1.cs |
Modernizes formatting and member access. |
TextureBrush/Clone/form1.cs |
Normalizes WinForms sample formatting. |
StringFormat/GetTabStops/form1.cs |
Adds collection expressions and formatting. |
Region/Complement/form1.cs |
Normalizes formatting and disposal logic. |
RectangleF/Inflate/form1.cs |
Modernizes WinForms scaffolding. |
Rectangle/Overview/Class1.cs |
Uses collection and object initializers. |
Rectangle/Inflate/form1.cs |
Modernizes WinForms scaffolding. |
Pen/Clone/form1.cs |
Uses object initializers and cleaner member access. |
ImageAnimator/Animate/form1.cs |
Simplifies event and member access. |
Image/Save/form1.cs |
Uses built-in aliases and normalized spacing. |
Graphics/SmoothingMode/form1.cs |
Uses object and collection initializers. |
Graphics/FillRectangle/form1.cs |
Modernizes arrays, initializers, and member access. |
Graphics/EnumerateMetafile/Form1.cs |
Sorts imports and normalizes formatting. |
Graphics/CopyFromScreen/Form1.cs |
Simplifies member access and type aliases. |
Graphics/Clip/form1.cs |
Normalizes WinForms and drawing code. |
FontFamily/Equals/form1.cs |
Repairs formatting and snippet structure. |
Font/Overview/form1.cs |
Modernizes WinForms initialization and handlers. |
Font/Clone/form1.cs |
Normalizes formatting and built-in types. |
ColorTranslator/FromHtml/form1.cs |
Modernizes WinForms scaffolding and spacing. |
ColorConverter/Overview/form1.cs |
Simplifies casts and member access. |
Color/Overview/form1.cs |
Modernizes controls and formatting calls. |
Color/Name/form1.cs |
Uses object and collection initializers. |
Color/FromArgb/form1.cs |
Normalizes arithmetic and declaration formatting. |
CharacterRange/Overview/form1.cs |
Modernizes arrays, events, and member access. |
CharacterRange/Equals/Form1.cs |
Normalizes spacing and member access. |
BufferedGraphics/Render/bufferingexamples.cs |
Cleans buffer API formatting. |
BufferedGraphics/Overview/bufferingtest.cs |
Modernizes buffering sample syntax. |
Brushes/Overview/form1.cs |
Normalizes WinForms and rectangle examples. |
Bitmap/SetResolution/Form1.cs |
Modernizes arrays and reorganizes snippets. |
Bitmap/Overview/form1.cs |
Modernizes controls, handlers, and initializers. |
Bitmap/Clone/form1.cs |
Simplifies disposal and member access. |
Bitmap/.ctor/Project.csproj |
Adds the consolidated .NET 10 WinForms project. |
Bitmap/.ctor/Program.cs |
Adds the shared executable entry point. |
Bitmap/.ctor/form12.cs |
Renames the form and converts Main to Run. |
Bitmap/.ctor/form11.cs |
Renames the form and converts Main to Run. |
Bitmap/.ctor/form1.cs |
Renames the form and converts Main to Run. |
Review details
Suppressed comments (1)
snippets/csharp/System.Drawing/BufferedGraphics/Overview/bufferingtest.cs:79
- Correct the typo in this explanatory comment.
// enabke the control style.
- Files reviewed: 38/38 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
gewarren
marked this pull request as ready for review
September 2, 2026 18:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contributes to #12713
Internal previews
Toggle expand/collapse
Build report