コード例 #1
0
        public string FindAncestorScopeName(string scopeName, int ancestorLevel)
        {
            ScopeTreeNode scopeTreeNode = default(ScopeTreeNode);

            if (this.m_scopesByName.TryGetValue(scopeName, out scopeTreeNode))
            {
                SubScopeNode subScopeNode = scopeTreeNode as SubScopeNode;
                if (subScopeNode != null)
                {
                    SubScopeNode subScopeNode2 = subScopeNode;
                    for (int i = 0; i < ancestorLevel; i++)
                    {
                        if (subScopeNode2.Scope is AspNetCore.ReportingServices.ReportIntermediateFormat.DataRegion)
                        {
                            break;
                        }
                        subScopeNode = (subScopeNode.ParentScope as SubScopeNode);
                        if (subScopeNode == null)
                        {
                            break;
                        }
                        subScopeNode2 = subScopeNode;
                    }
                    return(subScopeNode2.ScopeName);
                }
            }
            return(null);
        }
コード例 #2
0
        public IRIFDataScope RegisterCell(IRIFDataScope cell)
        {
            ScopeTreeNode scopeTreeNode = default(ScopeTreeNode);

            if (!this.m_scopes.TryGetValue(cell, out scopeTreeNode))
            {
                if (this.HasScope(this.m_activeRowScopes) && this.HasScope(this.m_activeColumnScopes))
                {
                    ScopeTreeNode first  = this.m_activeRowScopes.First;
                    ScopeTreeNode first2 = this.m_activeColumnScopes.First;
                    if (!this.TryGetCanonicalCellScope(first, first2, out scopeTreeNode))
                    {
                        scopeTreeNode = new IntersectScopeNode(cell, first, first2);
                        this.AddCanonicalCellScope(first, first2, scopeTreeNode);
                    }
                    ((IntersectScopeNode)scopeTreeNode).AddCell(cell);
                }
                else
                {
                    scopeTreeNode = new SubScopeNode(cell, this.m_activeScopes.First);
                }
            }
            this.AddScope(scopeTreeNode, cell);
            this.m_activeRowScopes    = this.m_activeRowScopes.Add(null);
            this.m_activeColumnScopes = this.m_activeColumnScopes.Add(null);
            return(scopeTreeNode.Scope);
        }
コード例 #3
0
        public int MeasureScopeDistance(string innerScopeName, string outerScopeName)
        {
            ScopeTreeNode scopeTreeNode = default(ScopeTreeNode);

            if (this.m_scopesByName.TryGetValue(innerScopeName, out scopeTreeNode))
            {
                SubScopeNode subScopeNode = scopeTreeNode as SubScopeNode;
                if (subScopeNode != null)
                {
                    int          num           = 0;
                    SubScopeNode subScopeNode2 = subScopeNode;
                    while (!string.Equals(subScopeNode2.ScopeName, outerScopeName, StringComparison.Ordinal))
                    {
                        subScopeNode = (subScopeNode.ParentScope as SubScopeNode);
                        if (subScopeNode == null)
                        {
                            return(-1);
                        }
                        subScopeNode2 = subScopeNode;
                        num++;
                    }
                    return(num);
                }
            }
            return(-1);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        public IRIFDataScope GetParentScope(IRIFDataScope scope)
        {
            SubScopeNode  subScopeNodeOrAssert = this.GetSubScopeNodeOrAssert(scope);
            ScopeTreeNode parentScope          = subScopeNodeOrAssert.ParentScope;

            if (parentScope != null)
            {
                return(parentScope.Scope);
            }
            return(null);
        }
コード例 #6
0
        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);
        }