dotnet / dotnet-api-docs

.NET API reference documentation (.NET 5+, .NET Core, .NET Framework)
https://docs.microsoft.com/dotnet/api/
Other
699 stars 1.54k forks source link

Winforms - Control.ResetBindings() summary seems incorrect? #2016

Open dsherret opened 5 years ago

dsherret commented 5 years ago

Right now the xml summary for Control.ResetBindings reads:

<summary>Causes a control bound to the <see cref="T:System.Windows.Forms.BindingSource" /> to reread all the items in the list and refresh their displayed values.</summary>

Docs - Control.xml

The implementation clears all the bindings though:

public void ResetBindings() {
    ControlBindingsCollection bindings = (ControlBindingsCollection)Properties.GetObject(PropBindings);
    if (bindings != null) {
        bindings.Clear();
    }
}

Source

I think perhaps this summary was copied from BindingSource? (Docs)

mairaw commented 5 years ago

Thanks for your feedback @dsherret. The summary does look incorrect indeed.

Would you like to suggest a fix for this?

dsherret commented 5 years ago

@mairaw Probably:

<summary>Clears all the bindings in the <see cref="DataBindings" /> collection.</summary>

I can submit a PR if that's ok? Do I just edit the Control.xml file?

By the way, I wonder why these remarks were added for this method: This method is not relevant for this class. -- Probably because the method is confusing and a better name would be ClearBindings() or for someone to deal with the DataBindings collection directly?