-
Notifications
You must be signed in to change notification settings - Fork 991
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Combine PropertyGrid tab information. (#6108)
Combine tab related data into a record for clarity and safety. Use a List<> instead of an array to avoid complicated insert logic. Maintain tab selection as an instance instead of an index. Move error handling to CreateTab so thrown exceptions with messages (missing a bitmap / name for the tab) are actually thrown instead of a silent failure.
- Loading branch information
1 parent
582c1b2
commit 39c1cfb
Showing
4 changed files
with
219 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/System.Windows.Forms/src/System/Windows/Forms/PropertyGrid.TabInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.ComponentModel; | ||
using System.Windows.Forms.Design; | ||
|
||
namespace System.Windows.Forms | ||
{ | ||
public partial class PropertyGrid | ||
{ | ||
private record TabInfo(PropertyTab Tab, PropertyTabScope Scope, ToolStripButton Button) | ||
{ | ||
public Type TabType => Tab.GetType(); | ||
} | ||
} | ||
} |
Oops, something went wrong.