Пример #1
0
 static void Main(string[] args)
 {
     JsonObject obj = new JsonObject(new Test() { Hello = "Test" });
     obj.SerializeObject(new Test2() { Monkey = "Banana" });
     
     var t = obj.DeserializeObject<Test>();
     var t2 = obj.DeserializeObject<Test2>();
     
     JsonArray a = new JsonArray() {
         new JsonObject("i", "hello"),
         new JsonObject("i", null)
     };
     obj.Properties.Test = "true";
     bool b = obj.Properties.Test;
     var i = a.FindAllObjects("i", null);
     var s = obj.GetValueAs<string>("Hello");
     (obj.Navigate("Parent/Child/GrandChild", true) as JsonObject)["Age"] = 15;
     return;
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new Form1());
     
 }
Пример #2
0
 public Form1()
 {
     InitializeComponent();
     o = new JsonObject("Hello", "World", "Name", "Troy", "YesNo", true);
     Obj co = o.DeserializeObject(typeof(Obj)) as Obj;
     propertyGrid1.SelectedObject = o;
     try
     {
         textBox1.DataBindings.Add(new Binding("Text", o, "Hello"));
     }
     catch (Exception ex)
     {
         
     }
     
 }