我最近熟悉了C#应用程序设置,感觉很酷。
我正在寻找一种存储自定义对象列表的方法,但是我找不到方法!
实际上,我看到了一个存储int[]的帖子,但对此问题没有帮助。
我试图更改该解决方案的配置以使其适用于我的问题。那个解决方案的XML配置文件如下:
<Setting Name="SomeTestSetting" Type="System.Int32[]" Scope="User">
<Value Profile="(Default)" />
</Setting>
我尝试在类型属性中如下引用我的对象,但这并没有帮助,因为它无法识别我的对象... 我尝试了"type = List"和"type="tuple[]"
这两个选项都没有帮助我!
我有一个类看起来像:
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; }
}
我想将一个列表存储在应用程序设置中。
那么有没有办法实现这个目的。
提前致谢。
祝好,