Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyItems
- {
- [JsonProperty("MyItems")]
- public IList<MyItemModel> Items { get; set; }
- }
- public class MyItemModel
- {
- public MyItem ItemMap { get; set; }
- public GeneralSettings Settings { get; set; }
- }
- public class MyItem
- {
- public string MapName { get; set; }
- public string MapDescription { get; set; }
- public string MapComments { get; set; }
- public string MapVersion { get; set; }
- }
- public class GeneralSettings
- {
- public Color Foreground { get; set; }
- public Color Background { get; set; }
- }
- // -------------------------------------------------
- // Serialize and deserialize the Root ObjectModel
- // -------------------------------------------------
- MyItems items = new MyItems();
- items.Items = new List<MyItemModel>() {
- new MyItemModel() {
- ItemMap = new MyItem() { MapName = "MyMapName", MapComments = "Comment" },
- Settings = new GeneralSettings() { Foreground = Color.Red, Background = Color.White }
- }
- }
- var serialized = JsonConvert.SerializeObject(items);
- var deserialized = JsonConvert.DeserializeObject<MyItems>(serialized);
Advertisement
Add Comment
Please, Sign In to add comment