2
什麼是創建一個可序列化作爲一個C#類的最佳方式:系列化C#對象JSON
marks: [
{ c: [57.162499, 65.54718], // latitude, longitude - this type of coordinates works only for World Map
tooltip: 'Tyumen - Click to go to http://yahoo.com', // text for tooltip
attrs: {
href: 'http://yahoo.com', // link
src: '/markers/pin1_red.png' // image for marker
}
},
{ xy: [50, 120], // x-y coodinates - works for all maps, including World Map
tooltip: 'This is London! Click to go to http://london.com',
attrs: {
href: 'http://yahoo.com', // link
src: '/markers/pin1_yellow.png' // image for marker
}
}
]
在上面的代碼中我們分配或者分配「C」或「XY」,但不能兩者都同一時間。 我正在使用Newtonsoft.Json。 我唯一想要的是可以序列化到上面的代碼的C#類。
你想有兩個屬性或兩個類的類? – 2012-08-16 13:03:03
@WouterdeKort:實際上是一個4類屬性{c,xy,tooltip,attrs}。 – 2012-08-16 13:27:46