示例#1
0
 public static JObject GetJObject(LS1APISpecObject item)
 {
     if (item == null)
     {
         return(null);
     }
     return(item.GetJObject());
 }
示例#2
0
 public static void Add(this JObject jo, string name, LS1APISpecObject obj)
 {
     if (obj == null)
     {
         jo.Add(name, null);
     }
     else
     {
         jo.Add(name, obj.GetJObject());
     }
 }
示例#3
0
 public static void FromJArray <T>(this ObservableCollection <T> list, JArray ja) where T : LS1APISpecObject, new()
 {
     list.Clear();
     if (ja == null)
     {
         return;
     }
     for (int i = 0; i < ja.Count; i++)
     {
         list.Add(LS1APISpecObject.FromJObject <T>(ja.GetAt(i)));
     }
 }
示例#4
0
        public static void FromJObject <T>(this ObservableCollection <T> list, JObject ja) where T : LS1APISpecObject, new()
        {
            list.Clear();
            if (ja == null)
            {
                return;
            }

            foreach (JProperty jp in ja.Properties())
            {
                T val = LS1APISpecObject.FromJObject <T>(ja, jp.Name);
                val.Name = jp.Name;

                list.Add(val);
            }
        }