Ejemplo n.º 1
0
 /// <summary> Construct a JSONObject from a subset of another JSONObject.
 /// An array of strings is used to identify the keys that should be copied.
 /// Missing keys are ignored.
 /// </summary>
 /// <param name="jo">A JSONObject.
 /// </param>
 /// <param name="names">An array of strings.
 /// </param>
 /// <throws>  JSONException  </throws>
 /// <exception cref="JSONException">If a value is a non-finite number or if a name is duplicated.
 /// </exception>
 public JSONObject(JSONObject jo, System.String[] names)
     : this()
 {
     for (int i = 0; i < names.Length; i += 1)
     {
         try
         {
             putOnce(names[i], jo.opt(names[i]));
         }
         catch (System.Exception)
         {
         }
     }
 }