예제 #1
0
 public override bool EqualsNode(ExprNode node)
 {
     if (node is ExprNodeValidated)
     {
         return(_inner.EqualsNode(((ExprNodeValidated)node)._inner));
     }
     return(_inner.EqualsNode(node));
 }
예제 #2
0
 public override bool EqualsNode(ExprNode node, bool ignoreStreamPrefix)
 {
     if (node is ExprNodeValidated)
     {
         return(_inner.EqualsNode(((ExprNodeValidated)node)._inner, false));
     }
     return(_inner.EqualsNode(node, false));
 }
예제 #3
0
        /// <summary>
        ///     Compare two expression nodes and their children in exact child-node sequence,
        ///     returning true if the 2 expression nodes trees are equals, or false if they are not equals.
        ///     <para />
        ///     Recursive call since it uses this method to compare child nodes in the same exact sequence.
        ///     Nodes are compared using the equalsNode method.
        /// </summary>
        /// <param name="nodeOne">first expression top node of the tree to compare</param>
        /// <param name="nodeTwo">second expression top node of the tree to compare</param>
        /// <param name="ignoreStreamPrefix">when the equals-comparison can ignore prefix of event properties</param>
        /// <returns>false if this or all child nodes are not equal, true if equal</returns>
        public static bool DeepEquals(
            ExprNode nodeOne,
            ExprNode nodeTwo,
            bool ignoreStreamPrefix)
        {
            if (nodeOne.ChildNodes.Length != nodeTwo.ChildNodes.Length) {
                return false;
            }

            if (!nodeOne.EqualsNode(nodeTwo, ignoreStreamPrefix)) {
                return false;
            }

            for (var i = 0; i < nodeOne.ChildNodes.Length; i++) {
                var childNodeOne = nodeOne.ChildNodes[i];
                var childNodeTwo = nodeTwo.ChildNodes[i];

                if (!DeepEquals(childNodeOne, childNodeTwo, ignoreStreamPrefix)) {
                    return false;
                }
            }

            return true;
        }