Krypton-Suite / Standard-Toolkit

An update to Component factory's krypton toolkit to support .NET Framework 4.6.2 - 4.8.1 to .NET 6 - 8
BSD 3-Clause "New" or "Revised" License
404 stars 62 forks source link

[Feature Request]: Add `[AllowNull]` to a controls `Text` field #756

Closed Smurf-IV closed 4 months ago

Smurf-IV commented 2 years ago

Part of the improvements in .net 6 / 7: image

from here: https://github.com/dotnet/winforms/commit/48616c47095149309b95caea9cc4e7c182313756

PWagner1 commented 1 year ago

Making the project 'nullable' should help with this

Smurf-IV commented 1 year ago

As part of this merge https://github.com/Krypton-Suite/Standard-Toolkit/pull/933

The [AllowNull]able attribute is now backward compatible with previous frameworks.

This will fix most of the following warnings in the compile: image

PWagner1 commented 1 year ago

Reminder!!!!! This should ought to be part of the extended toolkit as well ;)

PWagner1 commented 1 year ago

image

PWagner1 commented 1 year ago

@Smurf-IV Disable CS0436?

Smurf-IV commented 1 year ago

image

The following should be preventing it from appearing in anything above core 3.1: #if NETFRAMEWORK || NETCOREAPP ????

Smurf-IV commented 1 year ago

@Smurf-IV Disable CS0436?

I'll check what Frameworks I have installed; to make sure it is just the supported list ;-)

Smurf-IV commented 1 year ago

Seems to be okay, I do not get the following

@Smurf-IV Disable CS0436?

image

Smurf-IV commented 1 year ago

@Wagnerp Why is there still netcoreapp3.1 in the Krypton support list ?

image

Smurf-IV commented 1 year ago

@Smurf-IV Disable CS0436?

This was caused by the following code image

I'll fix it. (No idea why it was not showing up until I did a full rebuild !!

PWagner1 commented 1 year ago

@Wagnerp Why is there still netcoreapp3.1 in the Krypton support list ?

image

@Smurf-IV I'll remove it in the next PR

Smurf-IV commented 1 year ago

Oh, wow.. This is turning into a big PR.. Following all the nullable entries around the code is also "catching / pointing out" some unexpected locations where things could/will have gone awry.

Smurf-IV commented 1 year ago

As of 2023-02-06:

Changed All Standard toolkit projects to be

ToDo:

Smurf-IV commented 1 year ago

Note: The warnings and the enablement of these "Nullable" items will be ongoing, as other Features and Bugs are being worked on.

Smurf-IV commented 10 months ago

This may appear to be "dragging on" But even this past week MS are still pushing PR's into WinForms that are dealing with nullables ;-) https://learn.microsoft.com/en-us/dotnet/desktop/winforms/whats-new/net80?view=netdesktop-6.0#miscellaneous-improvements