private string LoadJsonObject() { string json = LoadText(); if (json.Length > 0) { GameBlock gb = JsonConvert.DeserializeObject <GameBlock> (json); Console.WriteLine("GameblockNr: " + gb.GameblockNr.ToString()); } return(json); }
private void CreateJsonObject() { //Example object for JSON serialization GameBlock gb = new GameBlock (); gb.GameblockNr = 3; gb.IsDeleted = true; gb.Kolom = 10; gb.Rij = 5; gb.X = 100; gb.Y = 100; gb.Background = Bitmap.CreateBitmap (100, 100, Bitmap.Config.Argb8888); string json = JsonConvert.SerializeObject (gb,Formatting.Indented,json_settings); SaveText (json); }
private void CreateJsonObject() { //Example object for JSON serialization GameBlock gb = new GameBlock(); gb.GameblockNr = 3; gb.IsDeleted = true; gb.Kolom = 10; gb.Rij = 5; gb.X = 100; gb.Y = 100; gb.Background = Bitmap.CreateBitmap(100, 100, Bitmap.Config.Argb8888); string json = JsonConvert.SerializeObject(gb, Formatting.Indented, json_settings); SaveText(json); }