public static JObject ColorArray(Color[] array) { var jObject = new JObject(); for (int index = 0; index < array.Length; index++) { var color = array[index]; string colorStr = JColor(color); jObject.AddPropertyString(index.ToString(), colorStr); } return(jObject); }
public static JObject StringArray(string[] array) { if (array == null || array.Length == 0) { return(null); } var jObject = new JObject(); for (int index = 0; index < array.Length; index++) { jObject.AddPropertyString(index.ToString(), array[index]); } return(jObject); }