private void mnuCopyValue_Click(object sender, EventArgs e) { var node = tvJson.SelectedNode; if (node?.Tag != null) { XJToken obj = node.Tag as XJToken; SetClipboard(obj.ValueString()); } else { SetClipboard(""); } }
private string GetShowText(XJToken jsonObject) { string txt = jsonObject.Name; if (jsonObject.IsRoot) { txt = "JSON"; } switch (jsonObject.JsonType) { case JsonType.Array: txt += " : [" + jsonObject.Children.Count + "]"; break; case JsonType.Object: txt += " : {" + jsonObject.Children.Count + "}"; break; default: txt += " : " + jsonObject.ValueString(); break; } return(txt); }