我最近熟悉了C#应用程序设置,看起来很酷。
我正在寻找一种方法来存储自定义对象的列表,但我找不到方法!
其实我看到一个post to store int[],但这对这个问题没有帮助。
我试图改变该解决方案的配置,以使其适合我的问题。的是,XML配置文件是:如何在应用程序设置中存储对象列表
<Setting Name="SomeTestSetting" Type="System.Int32[]" Scope="User">
<Value Profile="(Default)" />
</Setting>
我试图解决我的对象作为类型属性低于报价,但由于它不承认我的对象是没有什么帮助......我想“类型=列表“和‘TYPE =’元组[]”
这两个选项没有帮助我
我有一个类的样子:
class tuple
{
public tuple()
{
this.font = new Font ("Microsoft Sans Serif",8);
this.backgroundcolor_color = Color.White;
this.foregroundcolor_color = Color.Black;
}
public string log { get; set; }
public Font font { get ; set; }
public String fontName { get; set; }
public string foregroundcolor { get; set; }
public Color foregroundcolor_color { get; set; }
public string backgroundcolor { get; set; }
public Color backgroundcolor_color { get; set; }
public Boolean notification { get; set; }
}
,我想存储在应用程序列表设置。
所以有什么办法可以达到这个目的。
在此先感谢。
干杯,
可能的重复http://stackoverflow.com/questions/8627887/store-a-range-of-values-in-web-config-what-data-structure-to-use/8627974#8627974 – ivowiblo 2011-12-31 15:03:10
需要一个看看这里http://stackoverflow.com/questions/922047/store-dictionarystring-string-in-application-settings它可能会帮助你... – 2011-12-31 15:06:53