AddRoot() public method

Adds the root node of the tree.
public AddRoot ( ExpressionType type, object item ) : void
type ExpressionType The node type.
item object The item to add to the node.
return void
Ejemplo n.º 1
0
        public static ExpressionTree AssociateTrees(ExpressionTree a, ExpressionTree b, FilterImplication implication)
        {
            // check the parameters
            Debug.Assert(a != null && b != null, "Null parameters");

            ExpressionTree result = new ExpressionTree();
            result.AddRoot(ExpressionType.Implication, implication);
            result.Root.Left = a.Root;
            result.Root.Right = b.Root;
            return result;
        }
Ejemplo n.º 2
0
        public static ExpressionTree AssociateTreeWithFilter(ExpressionTree tree, FilterBase filter, 
            FilterImplication implication, TreeDirection treeDirection)
        {
            // check the parameters
            Debug.Assert(tree != null && filter != null, "Null parameters");
            ExpressionTree result = new ExpressionTree();

            if(treeDirection == TreeDirection.Left) {
                result.AddRoot(ExpressionType.Implication, implication);
                result.Root.Left = tree.Root;
                result.AddNode(result.Root, TreeDirection.Right, ExpressionType.Filter, filter);
            }
            else {
                result.AddRoot(ExpressionType.Implication, implication);
                result.Root.Right = tree.Root;
                result.AddNode(result.Root, TreeDirection.Left, ExpressionType.Filter, filter);
            }

            return result;
        }
Ejemplo n.º 3
0
        public static ExpressionTree AssociateFilters(FilterBase a, FilterBase b, 
            FilterImplication implication)
        {
            // check the parameters
            Debug.Assert(a != null && b != null, "Null parameters");

            ExpressionTree result = new ExpressionTree();
            result.AddRoot(ExpressionType.Implication, implication);
            result.AddNode(result.Root, TreeDirection.Left, ExpressionType.Filter, a);
            result.AddNode(result.Root, TreeDirection.Right, ExpressionType.Filter, b);
            return result;
        }