Exemple #1
0
        bool HasRequiredTarget()
        {
            bool hasRequiredTarget = UseParentAsTargetNode
                ? _context.HasTargetParent(out XmlElementContext matchFailureContext, out bool existedInOriginal)
                : _context.HasTargetNode(out matchFailureContext, out existedInOriginal);

            if (hasRequiredTarget)
            {
                return(true);
            }

            HandleMissingTarget(matchFailureContext, existedInOriginal);
            return(false);
        }
        private bool HasRequiredTarget()
        {
            bool hasRequiredTarget;
            bool existedInOriginal;
            XmlElementContext matchFailureContext;

            if (UseParentAsTargetNode)
            {
                hasRequiredTarget = _context.HasTargetParent(out matchFailureContext, out existedInOriginal);
            }
            else
            {
                hasRequiredTarget = _context.HasTargetNode(out matchFailureContext, out existedInOriginal);
            }

            if (!hasRequiredTarget)
            {
                HandleMissingTarget(matchFailureContext, existedInOriginal);
                return(false);
            }

            return(true);
        }