Exemple #1
0
        /// <summary>
        /// Create a TreeNode and its subtrees for the <paramref name="obj"/> instance beeing a <see cref="JArray"/> instance.
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="depth"></param>
        /// <returns></returns>
        public static TreeNode Create(JArray obj, int depth)
        {
            var node = new JArrayTreeNode(obj);

            if (depth != 1)
            {
                int remainingDepth = (depth == UnlimitedDepth ? UnlimitedDepth : depth - 1);
                node.Nodes.AddRange(obj
                                    .Select(o => Create((dynamic)o, remainingDepth))
                                    .Cast <TreeNode>()
                                    .ToArray()
                                    );
            }

            return(node);
        }
        /// <summary>
        /// Create a TreeNode and its subtrees for the <paramref name="obj"/> instance beeing a <see cref="JArray"/> instance.
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="depth"></param>
        /// <returns></returns>
        public static TreeNode Create(JArray obj, int depth)
        {
            var node = new JArrayTreeNode(obj);

            if (depth != 1)
            {
                int remainingDepth = (depth == UnlimitedDepth ? UnlimitedDepth : depth - 1);
                node.Nodes.AddRange(obj
                    .Select(o => Create((dynamic)o, remainingDepth))
                    .Cast<TreeNode>()
                    .ToArray()
                    );
            }

            return node;
        }
 /// <summary>
 /// Copies a JValue into a JArray as first child.
 /// </summary>
 /// <param name="sourceNode"></param>
 /// <param name="targetNode"></param>
 private void DoDragDropCopy(JValueTreeNode sourceNode, JArrayTreeNode targetNode)
 {
     sourceNode.ClipboardCopy();
     targetNode.ClipboardPasteInto();
 }
 /// <summary>
 /// Copies a JObject into a JArray as first child.
 /// </summary>
 /// <param name="sourceNode"></param>
 /// <param name="targetNode"></param>
 private void DoDragDropMove(JObjectTreeNode sourceNode, JArrayTreeNode targetNode)
 {
     sourceNode.ClipboardCut();
     targetNode.ClipboardPasteInto();
 }
Exemple #5
0
 /// <summary>
 /// Copies a JObject into a JArray as first child.
 /// </summary>
 /// <param name="sourceNode"></param>
 /// <param name="targetNode"></param>
 private void DoDragDropMove(JObjectTreeNode sourceNode, JArrayTreeNode targetNode)
 {
     sourceNode.ClipboardCut();
     targetNode.ClipboardPasteInto();
 }
Exemple #6
0
 /// <summary>
 /// Copies a JArray into a JArray as first child.
 /// </summary>
 /// <param name="sourceNode"></param>
 /// <param name="targetNode"></param>
 private void DoDragDropCopy(JArrayTreeNode sourceNode, JArrayTreeNode targetNode)
 {
     sourceNode.ClipboardCopy();
     targetNode.ClipboardPasteInto();
 }