private void ShowAddPropertyDialog() { JsonPropertyForm form = new JsonPropertyForm(delegate (string name, object value, int type) { string[] arr = new string[3]; arr[0] = name; arr[1] = value.ToString(); if (type == JsonPropertyForm.TYPE_STRING) { arr[2] = "string"; } else if (type == JsonPropertyForm.TYPE_INT) { arr[2] = "int"; } else if (type == JsonPropertyForm.TYPE_DOUBLE) { arr[2] = "double"; } ListViewItem item = new ListViewItem(arr); currentJsonView.Items.Add(item); }); form.ShowDialog(); }
private void currentJsonView_DoubleClick(object sender, EventArgs e) { JsonPropertyForm form = new JsonPropertyForm(currentJsonView.SelectedItems[0], delegate (string name, object value, int type) { string[] arr = new string[3]; arr[0] = name; arr[1] = value.ToString(); if (type == JsonPropertyForm.TYPE_STRING) { arr[2] = "string"; } else if (type == JsonPropertyForm.TYPE_INT) { arr[2] = "int"; } else if (type == JsonPropertyForm.TYPE_DOUBLE) { arr[2] = "double"; } ListViewItem item = new ListViewItem(arr); currentJsonView.Items[currentJsonView.SelectedIndices[0]] = item; }); form.ShowDialog(); }