public void SetImage()
{
if (this.ValueType != JSONType.Object && this.ValueType != JSONType.ObjectArray) { return; }
if (this.ContainsOnlyObjects && this.ChildJSONObjects.Count > 1)
{
this.TreeNode.ImageIndex = 2;
this.TreeNode.SelectedImageIndex = 2;
this.ValueType = JSONType.ObjectArray;
}
else if (this.ContainsObjects)
{
this.TreeNode.ImageIndex = 0;
this.TreeNode.SelectedImageIndex = 0;
this.ValueType = JSONType.Object;
}
else
{
this.TreeNode.ImageIndex = 1;
this.TreeNode.SelectedImageIndex = 1;
this.ValueType = JSONType.Object;
}
}
public JSONObject AddNode() { JSONObject child = new JSONObject(); child.Parent = this; child.ValueType = JSONType.Object; this.ChildObjects.Add(child); if (NodeMenu != null) { child.NodeMenu = NodeMenu; child.TreeNode.ContextMenuStrip = NodeMenu; } child.SetImage(); this.TreeNode.Nodes.Add(child.TreeNode); this.TreeNode.Expand(); this.SetImage(); return child; }