Exemplo n.º 1
0
 void AddVisited(IQueryElement element, IQueryElement?newElement)
 {
     if (!VisitedElements.ContainsKey(element))
     {
         VisitedElements[element] = newElement;
     }
 }
Exemplo n.º 2
0
        IQueryElement?GetCurrentReplaced(IQueryElement element)
        {
            if (VisitedElements.TryGetValue(element, out var replaced))
            {
                if (replaced != null && replaced != element)
                {
                    while (replaced != null && VisitedElements.TryGetValue(replaced, out var another))
                    {
                        if (replaced == another)
                        {
                            break;
                        }
                        replaced = another;
                    }
                }
                return(replaced);
            }

            return(null);
        }