Skip to content

Conversation

@Tanya-Solyanik
Copy link
Contributor

@Tanya-Solyanik Tanya-Solyanik commented Apr 8, 2020

Summary

  • Corrected description of PrinterSettings.SupportsColor property.
  • added a CS code snippet that demonstrates how to obtain a correct value using PInvoke

Things to finish:

I'm looking for help with the third remaining checkbox. And I'm looking for guidance on how do we document APIs that just don't do what they were supposed to be doing. Thanks!

Fixes #4083

@dotnet-bot dotnet-bot added this to the April 2020 milestone Apr 8, 2020
…d a CS code snippet that demonstrates how to obtain a correct value using PInvoke
Copy link
Contributor

@carlossanlop carlossanlop left a comment

Choose a reason for hiding this comment

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

So far it looks good to me.
You can view your changes here: https://review.docs.microsoft.com/en-us/dotnet/api/system.drawing.printing.printersettings.supportscolor?view=dotnet-plat-ext-3.1&branch=pr-en-us-4087
In case you don't yet know how I got that link:

  • Click on "Details" in the OpenPublishing.Build leg of your CI
  • Scroll down to the bottom of the report
  • In the "Validated Files" table, click on the Preview URL, then navigate to the API you modified (PrinterSettings.SupportsColor).

@BillWagner BillWagner modified the milestones: April 2020, June 2020 Jun 1, 2020
@BillWagner
Copy link
Member

@Tanya-Solyanik Will you come back to work on this, or should we close it?

@Tanya-Solyanik
Copy link
Contributor Author

@BillWagner , I'll get back to it this week.

Comment on lines +1657 to +1658
<summary>On .NET Frameworks 1.1 to 4.8, .NET Core framework versions 3.1 and 3.0, and on .NET Framework Extensions 2.1 to 3.1, gets a value indicating whether this printer uses multiple adjacent color bits for each pixel. This value does not guarantee if this printer supports color.<br/>
On .NET 5, gets a value indicating whether this printer supports color printing.</summary>
Copy link
Contributor

Choose a reason for hiding this comment

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

@gewarren is there a preferred way of wording? I think in the last couple of PRs you worded it something like this:

Suggested change
<summary>On .NET Frameworks 1.1 to 4.8, .NET Core framework versions 3.1 and 3.0, and on .NET Framework Extensions 2.1 to 3.1, gets a value indicating whether this printer uses multiple adjacent color bits for each pixel. This value does not guarantee if this printer supports color.<br/>
On .NET 5, gets a value indicating whether this printer supports color printing.</summary>
<summary>In all .NET Framework and .NET Core versions, and in .NET Framework Extensions 2.1 to 3.1 gets a value indicating whether this printer uses multiple adjacent color bits for each pixel. This value does not guarantee if this printer supports color.<br/>
Starting .NET 5 gets a value indicating whether this printer supports color printing.</summary>

Copy link
Contributor

Choose a reason for hiding this comment

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

@RussKie I left a suggestion for how I would work it. I usually using the "Starting in version x..." verbiage in the breaking change docs, but not so much in the API ref docs.

## Remarks
## Remarks
On Framework version below .NET 5, to determine if the printer supports color, P/Invoke [DeviceCapabilitiesW](https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-devicecapabilitiesw) function​ with `DC_COLORDEVICE` capability.<br/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
On Framework version below .NET 5, to determine if the printer supports color, P/Invoke [DeviceCapabilitiesW](https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-devicecapabilitiesw) function​ with `DC_COLORDEVICE` capability.<br/>
On .NET versions prior to .NET 5, to determine if the printer supports color, use P/Invoke to invoke the [DeviceCapabilitiesW](/windows/win32/api/wingdi/nf-wingdi-devicecapabilitiesw) function​ with `DC_COLORDEVICE` capability.<br/>

On .NET 5, gets a value indicating whether this printer supports color printing.</summary>
<value>
<see langword="true" /> if this printer supports color; otherwise, <see langword="false" />.</value>
On versions below .NET 5, <see langword="true" /> if this printer uses multiple adjacent color bits for each pixel; otherwise, <see langword="false" />.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
On versions below .NET 5, <see langword="true" /> if this printer uses multiple adjacent color bits for each pixel; otherwise, <see langword="false" />.
.NET Core 3.1 and earlier versions: <see langword="true" /> if this printer uses multiple adjacent color bits for each pixel; otherwise, <see langword="false" />.

<value>
<see langword="true" /> if this printer supports color; otherwise, <see langword="false" />.</value>
On versions below .NET 5, <see langword="true" /> if this printer uses multiple adjacent color bits for each pixel; otherwise, <see langword="false" />.
On .NET 5 and above, <see langword="true" /> if this printer supports color; otherwise, <see langword="false" />.</value>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
On .NET 5 and above, <see langword="true" /> if this printer supports color; otherwise, <see langword="false" />.</value>
.NET 5 and later versions: <see langword="true" /> if this printer supports color; otherwise, <see langword="false" />.</value>

</ReturnValue>
<Docs>
<summary>Gets a value indicating whether this printer supports color printing.</summary>
<summary>On .NET Frameworks 1.1 to 4.8, .NET Core framework versions 3.1 and 3.0, and on .NET Framework Extensions 2.1 to 3.1, gets a value indicating whether this printer uses multiple adjacent color bits for each pixel. This value does not guarantee if this printer supports color.<br/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<summary>On .NET Frameworks 1.1 to 4.8, .NET Core framework versions 3.1 and 3.0, and on .NET Framework Extensions 2.1 to 3.1, gets a value indicating whether this printer uses multiple adjacent color bits for each pixel. This value does not guarantee if this printer supports color.<br/>
<summary>.NET 5.0 and later versions only: Gets a value that indicates whether this printer supports color printing.
.NET Framework 1.1 to 4.8, .NET Core 3.1 and 3.0, and .NET Framework Extensions 2.1 - 3.1 only: Gets a value that indicates whether this printer uses multiple adjacent color bits for each pixel. This value does not guarantee if this printer supports color.<br/>

Comment on lines +1657 to +1658
<summary>On .NET Frameworks 1.1 to 4.8, .NET Core framework versions 3.1 and 3.0, and on .NET Framework Extensions 2.1 to 3.1, gets a value indicating whether this printer uses multiple adjacent color bits for each pixel. This value does not guarantee if this printer supports color.<br/>
On .NET 5, gets a value indicating whether this printer supports color printing.</summary>
Copy link
Contributor

Choose a reason for hiding this comment

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

@RussKie I left a suggestion for how I would work it. I usually using the "Starting in version x..." verbiage in the breaking change docs, but not so much in the API ref docs.

@carlossanlop
Copy link
Contributor

@Tanya-Solyanik any chance you can take a look at the latest suggestions?

Base automatically changed from master to main March 5, 2021 20:52
@jeffhandley jeffhandley modified the milestones: June 2020, Backlog Apr 29, 2022
@ViktorHofer ViktorHofer added the needs-author-action An issue or pull request that requires more info or actions from the author. label Jun 1, 2022
@carlossanlop
Copy link
Contributor

@Tanya-Solyanik this has been stale for some time. Is it still on your radar?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Drawing needs-author-action An issue or pull request that requires more info or actions from the author.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PrinterSettings.SupportsColor property is broken

8 participants