English 中文(简体)
• 如何在银星上编成一个名单?
原标题:Howto serialize a List<T> in Silverlight?

我有一个称为“协调”的内容,载于另一个称为“部分”的类别清单。

public struct Coordinate
{
    public double Latitude { get; set; }
    public double Longtitude { get; set; }
    public double Altitude { get; set; }
    public DateTime Time { get; set; }
}

public class Segment
{
    private List<Coordinate> coordinates;
    ...
}

我愿利用银灯(视窗7)通过XmlSerializer对Segment进行序列化。 我从:XmlSerializern t supportList<T>。 如何以建议的方式将可再生阵列坐标序列化?

感谢Jurgen

最佳回答

我认为,应该始终设计自己的序列化格式。 几天来似乎有少数意见。

你们从来没有知道哪一个序列器变成了档案格式,你真的不希望能够阅读你的文件格式。 NET框架。

问题回答

我总是喜欢XmlSerializer的数据用户。 XmlSerializer没有在Vyilla银灯上,但数据查询器是存在的。

它不会有任何问题把你所显示的结构序列化。

你们是否尝试了? 哪一个特例建议不列入清单?

用于信息,一旦我拥有所有工具(VS2010 / Telephone 7 sdk等)。 我的计划是,看到第7号电话可做些什么,但<代码>XmlSerializer应是坚实的违约。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签