Skip to content

Commit 58159f3

Browse files
authored
Enable nullability in some Control members (#7110)
1 parent 8e757eb commit 58159f3

File tree

9 files changed

+82
-84
lines changed

9 files changed

+82
-84
lines changed

src/System.Windows.Forms/src/PublicAPI.Shipped.txt

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -995,22 +995,22 @@ System.Windows.Forms.AxHost.State.State(System.Runtime.Serialization.Serializati
995995
~System.Windows.Forms.ContainerControl.ParentForm.get -> System.Windows.Forms.Form
996996
System.Windows.Forms.ContextMenuStrip.ContextMenuStrip(System.ComponentModel.IContainer! container) -> void
997997
System.Windows.Forms.ContextMenuStrip.SourceControl.get -> System.Windows.Forms.Control?
998-
~System.Windows.Forms.Control.AccessibilityObject.get -> System.Windows.Forms.AccessibleObject
999-
~System.Windows.Forms.Control.AccessibleDefaultActionDescription.get -> string
1000-
~System.Windows.Forms.Control.AccessibleDefaultActionDescription.set -> void
1001-
~System.Windows.Forms.Control.AccessibleDescription.get -> string
1002-
~System.Windows.Forms.Control.AccessibleDescription.set -> void
1003-
~System.Windows.Forms.Control.AccessibleName.get -> string
1004-
~System.Windows.Forms.Control.AccessibleName.set -> void
998+
System.Windows.Forms.Control.AccessibilityObject.get -> System.Windows.Forms.AccessibleObject!
999+
System.Windows.Forms.Control.AccessibleDefaultActionDescription.get -> string?
1000+
System.Windows.Forms.Control.AccessibleDefaultActionDescription.set -> void
1001+
System.Windows.Forms.Control.AccessibleDescription.get -> string?
1002+
System.Windows.Forms.Control.AccessibleDescription.set -> void
1003+
System.Windows.Forms.Control.AccessibleName.get -> string?
1004+
System.Windows.Forms.Control.AccessibleName.set -> void
10051005
~System.Windows.Forms.Control.BeginInvoke(System.Action method) -> System.IAsyncResult
10061006
~System.Windows.Forms.Control.BeginInvoke(System.Delegate method) -> System.IAsyncResult
10071007
~System.Windows.Forms.Control.BeginInvoke(System.Delegate method, params object[] args) -> System.IAsyncResult
10081008
~System.Windows.Forms.Control.CompanyName.get -> string
10091009
~System.Windows.Forms.Control.Contains(System.Windows.Forms.Control ctl) -> bool
1010-
~System.Windows.Forms.Control.Control(string text) -> void
1011-
~System.Windows.Forms.Control.Control(string text, int left, int top, int width, int height) -> void
1012-
~System.Windows.Forms.Control.Control(System.Windows.Forms.Control parent, string text) -> void
1013-
~System.Windows.Forms.Control.Control(System.Windows.Forms.Control parent, string text, int left, int top, int width, int height) -> void
1010+
System.Windows.Forms.Control.Control(string? text) -> void
1011+
System.Windows.Forms.Control.Control(string? text, int left, int top, int width, int height) -> void
1012+
System.Windows.Forms.Control.Control(System.Windows.Forms.Control? parent, string? text) -> void
1013+
System.Windows.Forms.Control.Control(System.Windows.Forms.Control? parent, string? text, int left, int top, int width, int height) -> void
10141014
~System.Windows.Forms.Control.Controls.get -> System.Windows.Forms.Control.ControlCollection
10151015
~System.Windows.Forms.Control.CreateGraphics() -> System.Drawing.Graphics
10161016
~System.Windows.Forms.Control.DataBindings.get -> System.Windows.Forms.ControlBindingsCollection
@@ -2024,8 +2024,8 @@ System.Windows.Forms.UpDownBase.DockPadding.get -> System.Windows.Forms.Scrollab
20242024
~virtual System.Windows.Forms.ComboBox.OnSelectionChangeCommitted(System.EventArgs e) -> void
20252025
~virtual System.Windows.Forms.ComboBox.OnTextUpdate(System.EventArgs e) -> void
20262026
~virtual System.Windows.Forms.ContainerControl.OnAutoValidateChanged(System.EventArgs e) -> void
2027-
~virtual System.Windows.Forms.Control.BackgroundImage.get -> System.Drawing.Image
2028-
~virtual System.Windows.Forms.Control.BackgroundImage.set -> void
2027+
virtual System.Windows.Forms.Control.BackgroundImage.get -> System.Drawing.Image?
2028+
virtual System.Windows.Forms.Control.BackgroundImage.set -> void
20292029
~virtual System.Windows.Forms.Control.BindingContext.get -> System.Windows.Forms.BindingContext
20302030
~virtual System.Windows.Forms.Control.BindingContext.set -> void
20312031
~virtual System.Windows.Forms.Control.ContextMenuStrip.get -> System.Windows.Forms.ContextMenuStrip
@@ -2038,8 +2038,8 @@ System.Windows.Forms.UpDownBase.DockPadding.get -> System.Windows.Forms.Scrollab
20382038
~virtual System.Windows.Forms.Control.DefaultCursor.get -> System.Windows.Forms.Cursor
20392039
~virtual System.Windows.Forms.Control.Font.get -> System.Drawing.Font
20402040
~virtual System.Windows.Forms.Control.Font.set -> void
2041-
~virtual System.Windows.Forms.Control.GetAccessibilityObjectById(int objectId) -> System.Windows.Forms.AccessibleObject
2042-
~virtual System.Windows.Forms.Control.LayoutEngine.get -> System.Windows.Forms.Layout.LayoutEngine
2041+
virtual System.Windows.Forms.Control.GetAccessibilityObjectById(int objectId) -> System.Windows.Forms.AccessibleObject?
2042+
virtual System.Windows.Forms.Control.LayoutEngine.get -> System.Windows.Forms.Layout.LayoutEngine!
20432043
~virtual System.Windows.Forms.Control.OnAutoSizeChanged(System.EventArgs e) -> void
20442044
~virtual System.Windows.Forms.Control.OnBackColorChanged(System.EventArgs e) -> void
20452045
~virtual System.Windows.Forms.Control.OnBackgroundImageChanged(System.EventArgs e) -> void
@@ -5947,10 +5947,10 @@ System.Windows.Forms.Control.AccessibilityNotifyClients(System.Windows.Forms.Acc
59475947
System.Windows.Forms.Control.AccessibilityNotifyClients(System.Windows.Forms.AccessibleEvents accEvent, int objectID, int childID) -> void
59485948
System.Windows.Forms.Control.AccessibleRole.get -> System.Windows.Forms.AccessibleRole
59495949
System.Windows.Forms.Control.AccessibleRole.set -> void
5950-
System.Windows.Forms.Control.AutoSizeChanged -> System.EventHandler
5951-
System.Windows.Forms.Control.BackColorChanged -> System.EventHandler
5952-
System.Windows.Forms.Control.BackgroundImageChanged -> System.EventHandler
5953-
System.Windows.Forms.Control.BackgroundImageLayoutChanged -> System.EventHandler
5950+
System.Windows.Forms.Control.AutoSizeChanged -> System.EventHandler?
5951+
System.Windows.Forms.Control.BackColorChanged -> System.EventHandler?
5952+
System.Windows.Forms.Control.BackgroundImageChanged -> System.EventHandler?
5953+
System.Windows.Forms.Control.BackgroundImageLayoutChanged -> System.EventHandler?
59545954
System.Windows.Forms.Control.BindingContextChanged -> System.EventHandler
59555955
System.Windows.Forms.Control.Bottom.get -> int
59565956
System.Windows.Forms.Control.Bounds.get -> System.Drawing.Rectangle

src/System.Windows.Forms/src/System/Windows/Forms/CheckBox.CheckBoxAccessibleObject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public override string DefaultAction
2222
{
2323
get
2424
{
25-
string defaultAction = Owner.AccessibleDefaultActionDescription;
25+
string? defaultAction = Owner.AccessibleDefaultActionDescription;
2626

2727
if (defaultAction is not null)
2828
{

src/System.Windows.Forms/src/System/Windows/Forms/ComboBox.ComboBoxAccessibleObject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public override string DefaultAction
176176
{
177177
get
178178
{
179-
string defaultAction = _owningComboBox.AccessibleDefaultActionDescription;
179+
string? defaultAction = _owningComboBox.AccessibleDefaultActionDescription;
180180
if (defaultAction is not null)
181181
{
182182
return defaultAction;

0 commit comments

Comments
 (0)