internal IRIFDataScope RegisterCell(IRIFDataScope cell)
 {
     if (!m_scopes.TryGetValue(cell, out ScopeTreeNode value))
     {
         if (HasScope(m_activeRowScopes) && HasScope(m_activeColumnScopes))
         {
             ScopeTreeNode first  = m_activeRowScopes.First;
             ScopeTreeNode first2 = m_activeColumnScopes.First;
             if (!TryGetCanonicalCellScope(first, first2, out value))
             {
                 value = new IntersectScopeNode(cell, first, first2);
                 AddCanonicalCellScope(first, first2, value);
             }
             ((IntersectScopeNode)value).AddCell(cell);
         }
         else
         {
             value = new SubScopeNode(cell, m_activeScopes.First);
         }
     }
     AddScope(value, cell);
     m_activeRowScopes    = m_activeRowScopes.Add(null);
     m_activeColumnScopes = m_activeColumnScopes.Add(null);
     return(value.Scope);
 }
        private IntersectScopeNode GetIntersectScopeNodeOrAssert(IRIFDataScope scope)
        {
            IntersectScopeNode intersectScopeNode = GetScopeNodeOrAssert(scope) as IntersectScopeNode;

            Global.Tracer.Assert(intersectScopeNode != null, "Specified scope was not an IntersectScopeNode ");
            return(intersectScopeNode);
        }