The new Dictionary<Tkey,TValue>
in .net 4.0 is serializable, so... can I now somehow use this in the Settings.Settings
or Settings.Designer.cs
?
views:
23answers:
1
+1
A:
Sort of. You can define a non-generic class that inherits from the generic class and then reference it in your settings. For example:
namespace MyNamespace
{
public class MyClassDictionary : System.Collections.Generic.Dictionary<string, MyClass>
{}
}
Your namespace may not appear in the list of assemblies/namespaces when you select "browse" for your setting's type, but you can just enter the fully qualified name of the type (e.g., MyNamespace.MyClassDictionary
) into the text box at the bottom of the dialog. You will need to compile once after defining your custom collection.
DGGenuine
2010-10-28 21:15:04