protected RuntimeHierarchyObjReference CreateHierarchyObjAndAddToParent()
        {
            RuntimeHierarchyObjReference runtimeHierarchyObjReference = null;

            try
            {
                RuntimeHierarchyObj runtimeHierarchyObj = new RuntimeHierarchyObj(m_owner, m_objectType, ((IScope)m_owner).Depth + 1);
                runtimeHierarchyObjReference = (RuntimeHierarchyObjReference)runtimeHierarchyObj.SelfReference;
                runtimeHierarchyObj.NextRow();
            }
            finally
            {
                if (null != runtimeHierarchyObjReference)
                {
                    runtimeHierarchyObjReference.UnPinValue();
                }
            }
            return(runtimeHierarchyObjReference);
        }
        internal override void NextRow(object keyValue, bool hasParent, object parentKey)
        {
            IReference <RuntimeHierarchyObj> value = null;

            try
            {
                m_hashtable.TryGetValue(keyValue, out value);
            }
            catch (ReportProcessingException_SpatialTypeComparisonError reportProcessingException_SpatialTypeComparisonError)
            {
                throw new ReportProcessingException(m_owner.RegisterSpatialTypeComparisonError(reportProcessingException_SpatialTypeComparisonError.Type));
            }
            catch (ReportProcessingException_ComparisonError e)
            {
                throw new ReportProcessingException(m_owner.RegisterComparisonError("GroupExpression", e));
            }
            if (value != null)
            {
                using (value.PinValue())
                {
                    value.Value().NextRow();
                }
                return;
            }
            RuntimeHierarchyObj runtimeHierarchyObj = new RuntimeHierarchyObj(m_owner, m_objectType, ((IScope)m_owner).Depth + 1);

            value = (IReference <RuntimeHierarchyObj>)runtimeHierarchyObj.SelfReference;
            try
            {
                m_hashtable.Add(keyValue, value);
                runtimeHierarchyObj = value.Value();
                runtimeHierarchyObj.NextRow();
                if (hasParent)
                {
                    IReference <RuntimeHierarchyObj> value2    = null;
                    IReference <RuntimeGroupLeafObj> reference = null;
                    try
                    {
                        m_hashtable.TryGetValue(parentKey, out value2);
                    }
                    catch (ReportProcessingException_SpatialTypeComparisonError reportProcessingException_SpatialTypeComparisonError2)
                    {
                        throw new ReportProcessingException(m_owner.RegisterSpatialTypeComparisonError(reportProcessingException_SpatialTypeComparisonError2.Type));
                    }
                    catch (ReportProcessingException_ComparisonError e2)
                    {
                        throw new ReportProcessingException(m_owner.RegisterComparisonError("Parent", e2));
                    }
                    if (value2 != null)
                    {
                        RuntimeHierarchyObj runtimeHierarchyObj2 = value2.Value();
                        Global.Tracer.Assert(runtimeHierarchyObj2.HierarchyObjs != null, "(null != parentHierarchyObj.HierarchyObjs)");
                        reference = (RuntimeGroupLeafObjReference)runtimeHierarchyObj2.HierarchyObjs[0];
                    }
                    Global.Tracer.Assert(runtimeHierarchyObj.HierarchyObjs != null, "(null != hierarchyObj.HierarchyObjs)");
                    RuntimeGroupLeafObjReference runtimeGroupLeafObjReference = (RuntimeGroupLeafObjReference)runtimeHierarchyObj.HierarchyObjs[0];
                    bool addToWaitList = true;
                    if (reference == runtimeGroupLeafObjReference)
                    {
                        reference     = null;
                        addToWaitList = false;
                    }
                    ProcessChildren(keyValue, reference, runtimeGroupLeafObjReference);
                    ProcessParent(parentKey, reference, runtimeGroupLeafObjReference, addToWaitList);
                }
            }
            finally
            {
                value.UnPinValue();
            }
        }