Ejemplo n.º 1
0
        internal override void SetupContext(IInstancePath rifObject, IReportScopeInstance romInstance, int moveNextInstanceIndex)
        {
            bool flag             = false;
            bool needDeepCopyPath = false;

            if (romInstance == null)
            {
                flag             = true;
                m_lastRIFObject  = rifObject;
                needDeepCopyPath = true;
            }
            else if (romInstance.IsNewContext || m_lastROMInstance == null || m_lastRIFObject == null || 0 <= moveNextInstanceIndex)
            {
                flag = true;
                romInstance.IsNewContext = false;
                m_lastROMInstance        = romInstance;
                m_lastRIFObject          = rifObject;
                needDeepCopyPath         = true;
            }
            else if (m_lastROMInstance.Equals(romInstance))
            {
                if (!m_lastRIFObject.Equals(rifObject) && (m_lastRIFObject.InstancePathItem.Type == InstancePathItemType.SubReport || rifObject.InstancePathItem.Type == InstancePathItemType.SubReport))
                {
                    flag = true;
                }
                m_lastRIFObject = rifObject;
            }
            else if (m_lastRIFObject.Equals(rifObject))
            {
                m_lastROMInstance = romInstance;
            }
            else if (InstancePathItem.IsSamePath(m_lastInstancePath, rifObject.InstancePath))
            {
                m_lastROMInstance = romInstance;
                m_lastRIFObject   = rifObject;
            }
            else
            {
                flag = true;
                m_lastROMInstance = romInstance;
                m_lastRIFObject   = rifObject;
                needDeepCopyPath  = true;
            }
            if (flag)
            {
                SetupObjectModels(OnDemandMode.FullSetup, needDeepCopyPath, moveNextInstanceIndex, null);
                m_odpContext.ReportRuntime.ContextUpdated = true;
            }
        }
        internal static bool IsSameScopePath(IInstancePath originalRIFObject, IInstancePath lastRIFObject)
        {
            if (originalRIFObject == null != (lastRIFObject == null))
            {
                return(false);
            }
            if (originalRIFObject == null && lastRIFObject == null)
            {
                return(true);
            }
            if (originalRIFObject.Equals(lastRIFObject))
            {
                return(true);
            }
            List <InstancePathItem> instancePath  = originalRIFObject.InstancePath;
            List <InstancePathItem> instancePath2 = lastRIFObject.InstancePath;
            bool identicalPaths;
            int  sharedPathIndex = GetSharedPathIndex(0, instancePath, instancePath2, returnPreviousIndex: false, out identicalPaths);

            if (identicalPaths)
            {
                return(true);
            }
            if (sharedPathIndex < 0)
            {
                return(false);
            }
            int count  = instancePath.Count;
            int count2 = instancePath2.Count;
            int i      = sharedPathIndex + 1;
            int j      = sharedPathIndex + 1;

            for (; i < count && !instancePath[i].IsScope; i++)
            {
            }
            if (i + 1 == count && instancePath[i].m_indexType == InstancePathItemType.SubReport)
            {
                i = count;
            }
            for (; j < count2 && !instancePath2[j].IsScope; j++)
            {
            }
            if (i == count && j == count2)
            {
                return(true);
            }
            return(false);
        }
        public static bool IsSameScopePath(IInstancePath originalRIFObject, IInstancePath lastRIFObject)
        {
            if (null == originalRIFObject != (null == lastRIFObject))
            {
                return(false);
            }
            if (originalRIFObject == null && lastRIFObject == null)
            {
                return(true);
            }
            if (originalRIFObject.Equals(lastRIFObject))
            {
                return(true);
            }
            List <InstancePathItem> instancePath  = originalRIFObject.InstancePath;
            List <InstancePathItem> instancePath2 = lastRIFObject.InstancePath;
            bool flag            = default(bool);
            int  sharedPathIndex = InstancePathItem.GetSharedPathIndex(0, instancePath, instancePath2, false, out flag);

            if (flag)
            {
                return(true);
            }
            if (sharedPathIndex < 0)
            {
                return(false);
            }
            int count  = instancePath.Count;
            int count2 = instancePath2.Count;
            int i      = sharedPathIndex + 1;
            int j      = sharedPathIndex + 1;

            for (; i < count && !instancePath[i].IsScope; i++)
            {
            }
            if (i + 1 == count && instancePath[i].m_indexType == InstancePathItemType.SubReport)
            {
                i = count;
            }
            for (; j < count2 && !instancePath2[j].IsScope; j++)
            {
            }
            if (i == count && j == count2)
            {
                return(true);
            }
            return(false);
        }