Convert `Hashtable` usage to `Dictionary<TKey, TValue`
See original GitHub issueIs your feature request related to a problem? Please describe
Hashtable has been used all over the winforms code base.
Describe the solution you’d like and alternatives you’ve considered
Refactoring to Dictionary<TKey, TValue
is explicit in its typing and avoids boxing.
The changes should not affect Public APIs.
System.Windows.Forms: 31 references System.Windows.Forms.Design: 126 references
Issue Analytics
- State:
- Created 10 months ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
How do I convert a powershell hashtable to an object?
Converting nested hashtables, i.e. an object graph, to a [pscustomobject] graph: A simple, though limited and potentially expensive solution is ...
Read more >Convert `Hashtable` usage to `Dictionary<TKey, TValue`
Windows Forms is a .NET UI framework for building Windows desktop applications. - Convert `Hashtable` usage to `Dictionary.
Read more >C# Hashtable (With Examples)
This tutorial explains Hashtable in C#. A hashtable stores key-value pairs. It retrieves the values by comparing the hash value of the keys....
Read more >about Hash Tables - PowerShell
A hashtable, also known as a dictionary or associative array, is a compact data structure that stores one or more key-value pairs.
Read more >Working with Hashtable and Dictionary in C
Determines whether the Hashtable contains a specific value. The following is an example showing the usage of Hashtable class in C# −. Example....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I see that
ContextMenuStripGroupCollection
, which is internal, overridesDictionaryBase
, which is basically just a wrapper around aHashTable
with extra events we’re not using. As part of this issue, do you agree it would be a good idea for this class to use aDictionary<string, ContextMenuStripGroup>
directly instead?ImmutablePropertyDescriptorGridEntry.PropertyValue
is something I am not 100% sure on. It creates anHashTable
into anIDictionary
variable, then passes that toTypeConverter.CreateInstance
. I imagine the underlying converter probably relies on it being a hashtable? Anyone have any ideas on where the TypeConverter code is located?https://github.com/dotnet/winforms/blob/4f4829de9a3b4c56496a60ec18d774ca40956b53/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGridInternal/ImmutablePropertyDescriptorGridEntry.cs#L47-L65