Skip to content

Commit db7efcf

Browse files
committed
Enable nullability in ArrayEditor
1 parent dba5d6e commit db7efcf

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#nullable enable
2-
~override System.ComponentModel.Design.ArrayEditor.CreateCollectionItemType() -> System.Type
3-
~override System.ComponentModel.Design.ArrayEditor.GetItems(object editValue) -> object[]
4-
~override System.ComponentModel.Design.ArrayEditor.SetItems(object editValue, object[] value) -> object
2+
override System.ComponentModel.Design.ArrayEditor.CreateCollectionItemType() -> System.Type!
3+
override System.ComponentModel.Design.ArrayEditor.GetItems(object? editValue) -> object![]!
4+
override System.ComponentModel.Design.ArrayEditor.SetItems(object? editValue, object![]? value) -> object?
55
~override System.Windows.Forms.Design.ComponentDocumentDesigner.Initialize(System.ComponentModel.IComponent component) -> void
66
~override System.Windows.Forms.Design.ComponentDocumentDesigner.PreFilterProperties(System.Collections.IDictionary properties) -> void
77
~override System.Windows.Forms.Design.ComponentTray.GetService(System.Type serviceType) -> object
@@ -33,7 +33,7 @@
3333
~override System.Windows.Forms.Design.ParentControlDesigner.SnapLines.get -> System.Collections.IList
3434
~override System.Windows.Forms.Design.WindowsFormsDesignerOptionService.PopulateOptionCollection(System.ComponentModel.Design.DesignerOptionService.DesignerOptionCollection options) -> void
3535
~static System.Windows.Forms.Design.ParentControlDesigner.InvokeCreateTool(System.Windows.Forms.Design.ParentControlDesigner toInvoke, System.Drawing.Design.ToolboxItem tool) -> void
36-
~System.ComponentModel.Design.ArrayEditor.ArrayEditor(System.Type type) -> void
36+
System.ComponentModel.Design.ArrayEditor.ArrayEditor(System.Type! type) -> void
3737
~System.ComponentModel.Design.DesignerActionMethodItem.DesignerActionMethodItem(System.ComponentModel.Design.DesignerActionList actionList, string memberName, string displayName) -> void
3838
~System.ComponentModel.Design.DesignerActionMethodItem.DesignerActionMethodItem(System.ComponentModel.Design.DesignerActionList actionList, string memberName, string displayName, bool includeAsDesignerVerb) -> void
3939
~System.ComponentModel.Design.DesignerActionMethodItem.DesignerActionMethodItem(System.ComponentModel.Design.DesignerActionList actionList, string memberName, string displayName, string category) -> void

src/System.Windows.Forms.Design/src/System/ComponentModel/Design/ArrayEditor.cs

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
#nullable disable
5-
64
namespace System.ComponentModel.Design;
75

86
/// <summary>
@@ -22,12 +20,12 @@ public ArrayEditor(Type type) : base(type)
2220
/// Gets or sets the data type this collection contains.
2321
/// </summary>
2422
protected override Type CreateCollectionItemType()
25-
=> CollectionType?.GetElementType();
23+
=> CollectionType?.GetElementType() ?? typeof(object);
2624

2725
/// <summary>
2826
/// Gets the items in the array.
2927
/// </summary>
30-
protected override object[] GetItems(object editValue)
28+
protected override object[] GetItems(object? editValue)
3129
{
3230
if (editValue is Array valueArray)
3331
{
@@ -42,7 +40,7 @@ protected override object[] GetItems(object editValue)
4240
/// <summary>
4341
/// Sets the items in the array.
4442
/// </summary>
45-
protected override object SetItems(object editValue, object[] value)
43+
protected override object? SetItems(object? editValue, object[]? value)
4644
{
4745
if (editValue is not null and not Array)
4846
{

0 commit comments

Comments
 (0)