private IntersectScopeNode GetIntersectScopeNodeOrAssert(IRIFDataScope scope)
        {
            ScopeTreeNode      scopeNodeOrAssert  = this.GetScopeNodeOrAssert(scope);
            IntersectScopeNode intersectScopeNode = scopeNodeOrAssert as IntersectScopeNode;

            Global.Tracer.Assert(intersectScopeNode != null, "Specified scope was not an IntersectScopeNode ");
            return(intersectScopeNode);
        }
 public override bool Traverse(ScopeTree.DirectedScopeTreeVisitor visitor)
 {
     if (visitor(base.Scope))
     {
         return(ScopeTreeNode.TraverseNode(visitor, this.m_parentScope));
     }
     return(false);
 }
        private SubScopeNode GetSubScopeNodeOrAssert(IRIFDataScope scope)
        {
            ScopeTreeNode scopeNodeOrAssert = this.GetScopeNodeOrAssert(scope);
            SubScopeNode  subScopeNode      = scopeNodeOrAssert as SubScopeNode;

            Global.Tracer.Assert(subScopeNode != null, "Specified scope was not a SubScope");
            return(subScopeNode);
        }
 public override bool Traverse(ScopeTree.DirectedScopeTreeVisitor visitor)
 {
     if (this.TraverseDefinitionCells(visitor) && ScopeTreeNode.TraverseNode(visitor, this.m_parentRowScope))
     {
         return(ScopeTreeNode.TraverseNode(visitor, this.m_parentColumnScope));
     }
     return(false);
 }
 public SubScopeNode(IRIFDataScope scope, ScopeTreeNode parentScope)
     : base(scope)
 {
     this.m_parentScope = parentScope;
     if (this.m_parentScope != null)
     {
         this.m_parentScope.AddChildScope(scope);
     }
 }
        public IRIFDataScope GetCanonicalCellScope(IRIFDataScope cell)
        {
            ScopeTreeNode scopeTreeNode = default(ScopeTreeNode);

            if (!this.m_scopes.TryGetValue(cell, out scopeTreeNode))
            {
                Global.Tracer.Assert(false, "GetCanonicalCellScope must not be called for a cell outside the ScopeTree.");
            }
            return(scopeTreeNode.Scope);
        }
        public IRIFDataScope GetScopeByName(string scopeName)
        {
            ScopeTreeNode scopeTreeNode = default(ScopeTreeNode);

            if (this.m_scopesByName.TryGetValue(scopeName, out scopeTreeNode))
            {
                return(scopeTreeNode.Scope);
            }
            return(null);
        }
        public bool IsSameOrParentScope(IRIFDataScope outerScope, IRIFDataScope innerScope)
        {
            ScopeTreeNode scopeTreeNode = default(ScopeTreeNode);

            if (this.m_scopes.TryGetValue(innerScope, out scopeTreeNode))
            {
                return(scopeTreeNode.IsSameOrParentScope(outerScope, false));
            }
            return(false);
        }
        public IRIFDataScope GetParentScope(IRIFDataScope scope)
        {
            SubScopeNode  subScopeNodeOrAssert = this.GetSubScopeNodeOrAssert(scope);
            ScopeTreeNode parentScope          = subScopeNodeOrAssert.ParentScope;

            if (parentScope != null)
            {
                return(parentScope.Scope);
            }
            return(null);
        }
        private ScopeTreeNode GetScopeNodeOrAssert(IRIFDataScope scope)
        {
            ScopeTreeNode result = default(ScopeTreeNode);

            if (this.m_scopes.TryGetValue(scope, out result))
            {
                return(result);
            }
            Global.Tracer.Assert(false, "Could not find scope in tree: {0}", scope);
            throw new InvalidOperationException();
        }
        private void AddGroupScope(AspNetCore.ReportingServices.ReportIntermediateFormat.ReportHierarchyNode member, ref FunctionalList <ScopeTreeNode> axisScopes)
        {
            ScopeTreeNode scopeTreeNode = default(ScopeTreeNode);

            if (!this.m_scopes.TryGetValue((IRIFDataScope)member, out scopeTreeNode))
            {
                scopeTreeNode = (this.HasScope(axisScopes) ? new SubScopeNode(member, this.m_activeScopes.First) : new SubScopeNode(member, this.m_dataRegionScopes.First));
            }
            this.AddScope(scopeTreeNode);
            axisScopes = axisScopes.Add(scopeTreeNode);
        }
        public string GetScopeName(IRIFDataScope scope)
        {
            string        text          = null;
            ScopeTreeNode scopeTreeNode = default(ScopeTreeNode);

            if (this.m_scopes.TryGetValue(scope, out scopeTreeNode))
            {
                return(scopeTreeNode.ScopeName);
            }
            return(scope.Name);
        }
        private void AddScope(ScopeTreeNode scopeNode, IRIFDataScope scope)
        {
            this.m_activeScopes  = this.m_activeScopes.Add(scopeNode);
            this.m_scopes[scope] = scopeNode;
            string scopeName = scopeNode.ScopeName;

            if (!string.IsNullOrEmpty(scopeName))
            {
                this.m_scopesByName[scopeNode.ScopeName] = scopeNode;
            }
        }
        private void AddCanonicalCellScope(ScopeTreeNode rowScope, ScopeTreeNode colScope, ScopeTreeNode cellScope)
        {
            Dictionary <string, ScopeTreeNode> dictionary = default(Dictionary <string, ScopeTreeNode>);

            if (!this.m_canonicalCellScopes.TryGetValue(rowScope.Scope.Name, out dictionary))
            {
                dictionary = new Dictionary <string, ScopeTreeNode>();
                this.m_canonicalCellScopes.Add(rowScope.Scope.Name, dictionary);
            }
            dictionary[colScope.Scope.Name] = cellScope;
        }
        private bool TryGetCanonicalCellScope(ScopeTreeNode rowScope, ScopeTreeNode colScope, out ScopeTreeNode canonicalCellScope)
        {
            Dictionary <string, ScopeTreeNode> dictionary = default(Dictionary <string, ScopeTreeNode>);

            if (this.m_canonicalCellScopes.TryGetValue(rowScope.Scope.Name, out dictionary) && dictionary.TryGetValue(colScope.Scope.Name, out canonicalCellScope))
            {
                return(true);
            }
            canonicalCellScope = null;
            return(false);
        }
        public void RegisterDataRegion(AspNetCore.ReportingServices.ReportIntermediateFormat.DataRegion dataRegion)
        {
            ScopeTreeNode scopeTreeNode = default(ScopeTreeNode);

            if (!this.m_scopes.TryGetValue((IRIFDataScope)dataRegion, out scopeTreeNode))
            {
                scopeTreeNode = new SubScopeNode(dataRegion, this.m_activeScopes.First);
            }
            this.AddScope(scopeTreeNode);
            this.m_dataRegionScopes   = this.m_dataRegionScopes.Add(scopeTreeNode);
            this.m_activeRowScopes    = this.m_activeRowScopes.Add(null);
            this.m_activeColumnScopes = this.m_activeColumnScopes.Add(null);
        }
 public IntersectScopeNode(IRIFDataScope scope, ScopeTreeNode parentRowScope, ScopeTreeNode parentColScope)
     : base(scope)
 {
     this.m_parentRowScope = parentRowScope;
     if (this.m_parentRowScope != null)
     {
         this.m_parentRowScope.AddChildScope(scope);
     }
     this.m_parentColumnScope = parentColScope;
     if (this.m_parentColumnScope != null)
     {
         this.m_parentColumnScope.AddChildScope(scope);
     }
     this.m_peerDataCells = new List <IRIFDataScope>();
 }
 protected static bool TraverseNode(ScopeTree.DirectedScopeTreeVisitor visitor, ScopeTreeNode node)
 {
     if (node != null)
     {
         return(node.Traverse(visitor));
     }
     return(true);
 }
        public IEnumerable <IRIFDataScope> GetChildScopes(IRIFDataScope parentScope)
        {
            ScopeTreeNode scopeNodeOrAssert = this.GetScopeNodeOrAssert(parentScope);

            return(scopeNodeOrAssert.ChildScopes);
        }
        public bool IsIntersectionScope(IRIFDataScope scope)
        {
            ScopeTreeNode scopeNodeOrAssert = this.GetScopeNodeOrAssert(scope);

            return(scopeNodeOrAssert is IntersectScopeNode);
        }
 private void AddScope(ScopeTreeNode scopeNode)
 {
     this.AddScope(scopeNode, scopeNode.Scope);
 }
        public void Traverse(ScopeTreeVisitor visitor, IRIFDataScope outerScope, IRIFDataScope innerScope, bool visitOuterScope)
        {
            ScopeTreeNode scopeNodeOrAssert = this.GetScopeNodeOrAssert(innerScope);

            scopeNodeOrAssert.Traverse(visitor, outerScope, visitOuterScope);
        }
        public bool Traverse(DirectedScopeTreeVisitor visitor, IRIFDataScope startScope)
        {
            ScopeTreeNode scopeNodeOrAssert = this.GetScopeNodeOrAssert(startScope);

            return(scopeNodeOrAssert.Traverse(visitor));
        }