Repository navigation
Conversation
The [Obsolete] messages of LayoutView.Print, GDI2DView.PrintSinglePage and PrintToGDI now name their replacement, as #412 requires for every class member removed in 2.0: the new extensions of CADability.Forms.GdiPrinting (PrintDocument.Print(LayoutView), PrintDocument.PrintSinglePage(GDI2DView), PrintDocument.PrintSinglePage(Project, string, bool) and Bitmap.DrawModel). In 1.x they forward to the kernel implementation; it moves into CADability.Forms in 2.0. The extensions take the PrintDocument or Bitmap as receiver because an extension on LayoutView or GDI2DView with the same name would be hidden by the instance method until 2.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YXvDW91oXpy7RquGHNxgR5
Collaborator
Author
|
Closing without merge. The printing extensions only existed to give the Generated by Claude Code |
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.
Part of #412 (step 7, printing). Stacked on #474; retarget to
masteronce #474 is merged.Why
#412 now requires that every class member removed in 2.0 is
[Obsolete]in 1.x naming its replacement. #474 markedLayoutView.Print,GDI2DView.PrintSinglePageandPrintToGDIobsolete, but their replacement did not exist yet, so the messages only said "moves into CADability.Forms in 2.0".What
CADability.Forms.GdiPrintingwith extension methods:PrintDocument.Print(LayoutView)replacesLayoutView.Print(PrintDocument)PrintDocument.PrintSinglePage(GDI2DView)replacesGDI2DView.PrintSinglePage(PrintDocument)PrintDocument.PrintSinglePage(Project, string, bool)replacesPrintToGDI.PrintSinglePage(...)Bitmap.DrawModel(Model, Projection, Layer[], bool, bool)replacesnew PrintToGDI(bitmap).PrintToBitmap(...)[Obsolete]messages now name these replacements.CADability.Formsin 2.0 (step 8).tests/GdiPrintingTests.cs(Windows only) checks thatDrawModelrenders pixel for pixel likePrintToGDI.PrintToBitmap, and that the line is actually drawn.Design notes
PrintDocumentor theBitmap, not the view. An extensionLayoutView.Print(PrintDocument)would be hidden by the instance method of the same name until 2.0, so callers could not switch to it.PrintToGDIclass in Forms in 1.x. A class with the same name inCADability.Formswould makePrintToGDIambiguous for code that has bothusing CADability;andusing CADability.Forms;, which is a source break. The class itself moves in 2.0.Deviations from the list in #412
IUIService.ShowPageSetupDlg/ShowPrintDlgkeep their[Obsolete]from Save page settings as a neutral PageSetup (#412, step 7b) #474; they are interface members, which the "name the replacement" rule for class members does not cover.PrintToGDI.LineWidthFactorandPrintToGDI.OnPrintPageget no extension of their own. In this repository only the kernel uses them, and the obsolete message on the class covers them.DontRecalcTriangulationis a member ofIPaintTo3Dand stays.Testing
CADability.Formsbuilds.CADability.Testson Linux: 621 passed, 21 skipped, 0 failed.net8.0-windows(-p:OS=Windows_NT). The Windows test itself runs on the Windows job of the integration branch ([Draft, do not merge] Integration branch for #412 #467).🤖 Generated with Claude Code
https://claude.ai/code/session_01YXvDW91oXpy7RquGHNxgR5