Dictionary<Tkey,TValue>
.net 4.0の新機能はシリアル化可能であるため、これをSettings.Settings
orで何とか使用できSettings.Designer.cs
ますか?
1 に答える
3
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.
于 2010-10-28T21:15:04.540 に答える