Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nullable annotations in ITypedList #80033

Merged
merged 1 commit into from
Jan 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -702,8 +702,8 @@ public partial interface ITypeDescriptorContext : System.IServiceProvider
}
public partial interface ITypedList
{
System.ComponentModel.PropertyDescriptorCollection GetItemProperties(System.ComponentModel.PropertyDescriptor[] listAccessors);
string GetListName(System.ComponentModel.PropertyDescriptor[] listAccessors);
System.ComponentModel.PropertyDescriptorCollection GetItemProperties(System.ComponentModel.PropertyDescriptor[]? listAccessors);
string GetListName(System.ComponentModel.PropertyDescriptor[]? listAccessors);
}
public abstract partial class License : System.IDisposable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ namespace System.ComponentModel
{
public interface ITypedList
{
string GetListName(PropertyDescriptor[] listAccessors);
string GetListName(PropertyDescriptor[]? listAccessors);

PropertyDescriptorCollection GetItemProperties(PropertyDescriptor[] listAccessors);
PropertyDescriptorCollection GetItemProperties(PropertyDescriptor[]? listAccessors);
}
}
8 changes: 4 additions & 4 deletions src/libraries/System.Data.Common/ref/System.Data.Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1049,8 +1049,8 @@ void System.ComponentModel.IBindingList.RemoveIndex(System.ComponentModel.Proper
void System.ComponentModel.IBindingList.RemoveSort() { }
void System.ComponentModel.IBindingListView.ApplySort(System.ComponentModel.ListSortDescriptionCollection sorts) { }
void System.ComponentModel.IBindingListView.RemoveFilter() { }
System.ComponentModel.PropertyDescriptorCollection System.ComponentModel.ITypedList.GetItemProperties(System.ComponentModel.PropertyDescriptor[] listAccessors) { throw null; }
string System.ComponentModel.ITypedList.GetListName(System.ComponentModel.PropertyDescriptor[] listAccessors) { throw null; }
System.ComponentModel.PropertyDescriptorCollection System.ComponentModel.ITypedList.GetItemProperties(System.ComponentModel.PropertyDescriptor[]? listAccessors) { throw null; }
string System.ComponentModel.ITypedList.GetListName(System.ComponentModel.PropertyDescriptor[]? listAccessors) { throw null; }
public System.Data.DataTable ToTable() { throw null; }
public System.Data.DataTable ToTable(bool distinct, params string[] columnNames) { throw null; }
public System.Data.DataTable ToTable(string? tableName) { throw null; }
Expand Down Expand Up @@ -1103,8 +1103,8 @@ void System.ComponentModel.IBindingList.ApplySort(System.ComponentModel.Property
int System.ComponentModel.IBindingList.Find(System.ComponentModel.PropertyDescriptor property, object key) { throw null; }
void System.ComponentModel.IBindingList.RemoveIndex(System.ComponentModel.PropertyDescriptor property) { }
void System.ComponentModel.IBindingList.RemoveSort() { }
System.ComponentModel.PropertyDescriptorCollection System.ComponentModel.ITypedList.GetItemProperties(System.ComponentModel.PropertyDescriptor[] listAccessors) { throw null; }
string System.ComponentModel.ITypedList.GetListName(System.ComponentModel.PropertyDescriptor[] listAccessors) { throw null; }
System.ComponentModel.PropertyDescriptorCollection System.ComponentModel.ITypedList.GetItemProperties(System.ComponentModel.PropertyDescriptor[]? listAccessors) { throw null; }
string System.ComponentModel.ITypedList.GetListName(System.ComponentModel.PropertyDescriptor[]? listAccessors) { throw null; }
protected virtual void TableCollectionChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e) { }
}
[System.ComponentModel.EditorAttribute("Microsoft.VSDesigner.Data.Design.DataViewRowStateEditor, Microsoft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
Expand Down
4 changes: 2 additions & 2 deletions src/libraries/System.Data.Common/src/System/Data/DataView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ internal ListSortDescriptionCollection GetSortDescriptions()

#region ITypedList

string System.ComponentModel.ITypedList.GetListName(PropertyDescriptor[] listAccessors)
string System.ComponentModel.ITypedList.GetListName(PropertyDescriptor[]? listAccessors)
{
if (_table != null)
{
Expand All @@ -1175,7 +1175,7 @@ string System.ComponentModel.ITypedList.GetListName(PropertyDescriptor[] listAcc
return string.Empty;
}

PropertyDescriptorCollection System.ComponentModel.ITypedList.GetItemProperties(PropertyDescriptor[] listAccessors)
PropertyDescriptorCollection System.ComponentModel.ITypedList.GetItemProperties(PropertyDescriptor[]? listAccessors)
{
if (_table != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ void IBindingList.RemoveSort()
}

// SDUB: GetListName and GetItemProperties almost the same in DataView and DataViewManager
string System.ComponentModel.ITypedList.GetListName(PropertyDescriptor[] listAccessors)
string System.ComponentModel.ITypedList.GetListName(PropertyDescriptor[]? listAccessors)
{
DataSet? dataSet = DataSet;
if (dataSet == null)
Expand All @@ -279,7 +279,7 @@ string System.ComponentModel.ITypedList.GetListName(PropertyDescriptor[] listAcc
return string.Empty;
}

PropertyDescriptorCollection System.ComponentModel.ITypedList.GetItemProperties(PropertyDescriptor[] listAccessors)
PropertyDescriptorCollection System.ComponentModel.ITypedList.GetItemProperties(PropertyDescriptor[]? listAccessors)
{
DataSet? dataSet = DataSet;
if (dataSet == null)
Expand Down