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
[API Proposal]: Allow ControlCollection.AddRange to use params keyword. #8938
Comments
This is great, we should expand it to list the other collections where we have an |
@JeremyKuhne Sure, should I make another PR after finding them? Or I can just push to my current fork? |
@ALiwoto listing them here is the priority. You can just expand the existing PR, but we won't be able to take it until we've got this approved by the .NET API review board. Please tag me when you think you've got everything listed here and I'll work on getting the official approval. |
Awesome! Great idea, minimal api impact, and improves usability. |
|
Thanks @ALiwoto. I've double checked and removed the internal ones. I've updated the proposal with the complete list. |
namespace System.Windows.Forms;
public partial class Control
{
public partial class ControlCollection
{
// Existing signature:
// public virtual void AddRange(Control[] controls);
public virtual void AddRange(params Control[] controls);
}
} |
@ALiwoto did you want to do the PR to implement it? |
Yes. @JeremyKuhne can I commit the changes to my current PR? Or I have to revert the last commit from it first? |
@ALiwoto you should probably change all of these in one PR. You can do it in your existing PR. Note, however, that you don't add to the |
…ord. Resolves dotnet#8938 Signed-off-by: Aliwoto <woto@kaizoku.cyou>
…ord. Resolves dotnet#8938 Signed-off-by: Aliwoto <woto@kaizoku.cyou>
…ord. Resolves dotnet#8938 Signed-off-by: Aliwoto <woto@kaizoku.cyou>
Background and motivation
Currently Control.ControlCollection.AddRange method is accepting an array of
Control
, this means each time that we want to add multiple controls at once, we have to make a new array. By usingparams
keyword using this method will become easier.API Proposal
params
keyword to all collectionAddRange
methods that don't already have it.Likewise we want to update our other collections that have an
AddRange
:API Usage
Risks
No known risks.
Will this feature affect UI controls?
The text was updated successfully, but these errors were encountered: