diff options
author | gpetrou <4172445+gpetrou@users.noreply.github.com> | 2022-11-13 16:28:42 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-13 16:28:42 +0300 |
commit | cc712fd7cb63fe92b730de0ac15a9012c7935cc9 (patch) | |
tree | 3acd91f430a67bbd3fa00b1d37c3543837168d42 | |
parent | 653be13516cea8317b4c307b31efba0bef8f1678 (diff) |
Fix nullable annotations in ITypeDescriptorContext (#78287)
4 files changed, 8 insertions, 8 deletions
diff --git a/src/libraries/System.ComponentModel.TypeConverter/ref/System.ComponentModel.TypeConverter.cs b/src/libraries/System.ComponentModel.TypeConverter/ref/System.ComponentModel.TypeConverter.cs index 4963ec94e30..8e77546fccb 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/ref/System.ComponentModel.TypeConverter.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/ref/System.ComponentModel.TypeConverter.cs @@ -694,9 +694,9 @@ namespace System.ComponentModel } public partial interface ITypeDescriptorContext : System.IServiceProvider { - System.ComponentModel.IContainer Container { get; } - object Instance { get; } - System.ComponentModel.PropertyDescriptor PropertyDescriptor { get; } + System.ComponentModel.IContainer? Container { get; } + object? Instance { get; } + System.ComponentModel.PropertyDescriptor? PropertyDescriptor { get; } void OnComponentChanged(); bool OnComponentChanging(); } diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ITypeDescriptorContext.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ITypeDescriptorContext.cs index 954ffe481ca..29f9589651a 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ITypeDescriptorContext.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ITypeDescriptorContext.cs @@ -12,17 +12,17 @@ namespace System.ComponentModel /// <summary> /// Gets the container with the set of objects for this formatter. /// </summary> - IContainer Container { get; } + IContainer? Container { get; } /// <summary> /// Gets the instance that is invoking the method on the formatter object. /// </summary> - object Instance { get; } + object? Instance { get; } /// <summary> /// Retrieves the PropertyDescriptor that is surfacing the given context item. /// </summary> - PropertyDescriptor PropertyDescriptor { get; } + PropertyDescriptor? PropertyDescriptor { get; } /// <summary> /// Gets a value indicating whether this object can be changed. diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ReferenceConverter.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ReferenceConverter.cs index 5d23a90fb78..24b64e1b01a 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ReferenceConverter.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ReferenceConverter.cs @@ -147,7 +147,7 @@ namespace System.ComponentModel else { // Now try IContainer. - IContainer cont = context.Container; + IContainer? cont = context.Container; if (cont != null) { ComponentCollection objs = cont.Components; diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/Design/DirectoryEntryConverter.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/Design/DirectoryEntryConverter.cs index 756be378e2d..d271095683c 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/Design/DirectoryEntryConverter.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/Design/DirectoryEntryConverter.cs @@ -38,7 +38,7 @@ namespace System.DirectoryServices.Design { newEntry = new DirectoryEntry(text); s_componentsCreated[text] = newEntry; - context?.Container.Add(newEntry); + context?.Container?.Add(newEntry); return newEntry; } |