public void TransferTo(IScalabilityCache scaleCache)
        {
            for (int i = 0; i < this.Entries.Length; i++)
            {
                IScalableDictionaryEntry scalableDictionaryEntry = this.Entries[i];
                if (scalableDictionaryEntry != null)
                {
                    switch (scalableDictionaryEntry.GetObjectType())
                    {
                    case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.ScalableDictionaryNodeReference:
                    {
                        ScalableDictionaryNodeReference scalableDictionaryNodeReference = scalableDictionaryEntry as ScalableDictionaryNodeReference;
                        this.Entries[i] = (ScalableDictionaryNodeReference)scalableDictionaryNodeReference.TransferTo(scaleCache);
                        break;
                    }

                    case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.ScalableDictionaryValues:
                    {
                        ScalableDictionaryValues scalableDictionaryValues = scalableDictionaryEntry as ScalableDictionaryValues;
                        scalableDictionaryValues.TransferTo(scaleCache);
                        break;
                    }

                    default:
                        Global.Tracer.Assert(false, "Unknown ObjectType");
                        break;
                    }
                }
            }
        }
        private void FreeChildren(ScalableDictionaryNodeReference nodeRef)
        {
            using (nodeRef.PinValue())
            {
                ScalableDictionaryNode scalableDictionaryNode = nodeRef.Value();
                for (int i = 0; i < scalableDictionaryNode.Entries.Length; i++)
                {
                    IScalableDictionaryEntry scalableDictionaryEntry = scalableDictionaryNode.Entries[i];
                    if (scalableDictionaryEntry != null)
                    {
                        switch (scalableDictionaryEntry.GetObjectType())
                        {
                        case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.ScalableDictionaryNodeReference:
                        {
                            ScalableDictionaryNodeReference scalableDictionaryNodeReference = scalableDictionaryEntry as ScalableDictionaryNodeReference;
                            this.FreeChildren(scalableDictionaryNodeReference);
                            scalableDictionaryNodeReference.Free();
                            break;
                        }

                        default:
                            Global.Tracer.Assert(false, "Unknown ObjectType");
                            break;

                        case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.ScalableDictionaryValues:
                            break;
                        }
                    }
                    scalableDictionaryNode.Entries[i] = null;
                }
                scalableDictionaryNode.Count = 0;
            }
        }
        public void Deserialize(IntermediateFormatReader reader)
        {
            reader.RegisterDeclaration(ScalableDictionary <TKey, TValue> .m_declaration);
            IScalabilityCache scalabilityCache = this.m_scalabilityCache = (reader.PersistenceHelper as IScalabilityCache);

            while (reader.NextMember())
            {
                switch (reader.CurrentMember.MemberName)
                {
                case MemberName.NodeCapacity:
                    this.m_nodeCapacity = reader.ReadInt32();
                    break;

                case MemberName.ValuesCapacity:
                    this.m_valuesCapacity = reader.ReadInt32();
                    break;

                case MemberName.Comparer:
                {
                    int id = reader.ReadInt32();
                    if (scalabilityCache.CacheType == ScalabilityCacheType.Standard)
                    {
                        this.m_comparer = (IEqualityComparer <TKey>)scalabilityCache.FetchStaticReference(id);
                    }
                    break;
                }

                case MemberName.Count:
                    this.m_count = reader.ReadInt32();
                    break;

                case MemberName.Version:
                    this.m_version = reader.ReadInt32();
                    break;

                case MemberName.Root:
                    this.m_root = (ScalableDictionaryNodeReference)reader.ReadRIFObject();
                    break;

                case MemberName.UseFixedReferences:
                    this.m_useFixedReferences = reader.ReadBoolean();
                    break;

                case MemberName.Priority:
                    this.m_priority = reader.ReadInt32();
                    break;

                default:
                    Global.Tracer.Assert(false);
                    break;
                }
            }
        }
            private bool FindNext()
            {
                bool flag = false;

                while (this.m_context.Count > 0 && !flag)
                {
                    ContextItem <int, ScalableDictionaryNodeReference> contextItem = this.m_context.Peek();
                    ScalableDictionaryNodeReference value = contextItem.Value;
                    using (value.PinValue())
                    {
                        flag = this.FindNext(value.Value(), contextItem);
                    }
                }
                return(flag);
            }
 public ScalableDictionary(int priority, IScalabilityCache cache, int nodeCapacity, int entryCapacity, IEqualityComparer <TKey> comparer, bool useFixedReferences)
 {
     this.m_priority           = priority;
     this.m_scalabilityCache   = cache;
     this.m_nodeCapacity       = nodeCapacity;
     this.m_valuesCapacity     = entryCapacity;
     this.m_comparer           = comparer;
     this.m_version            = 0;
     this.m_count              = 0;
     this.m_useFixedReferences = useFixedReferences;
     if (this.m_comparer == null)
     {
         this.m_comparer = EqualityComparer <TKey> .Default;
     }
     this.m_root = this.BuildNode(0, this.m_nodeCapacity);
 }
            private bool FindNext(ScalableDictionaryNode node, ContextItem <int, ScalableDictionaryNodeReference> curContext)
            {
                bool flag = false;

                while (!flag && curContext.Key < node.Entries.Length)
                {
                    IScalableDictionaryEntry scalableDictionaryEntry = node.Entries[curContext.Key];
                    if (scalableDictionaryEntry != null)
                    {
                        switch (scalableDictionaryEntry.GetObjectType())
                        {
                        case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.ScalableDictionaryNodeReference:
                        {
                            ScalableDictionaryNodeReference value = scalableDictionaryEntry as ScalableDictionaryNodeReference;
                            this.m_context.Push(new ContextItem <int, ScalableDictionaryNodeReference>(0, value));
                            flag = this.FindNext();
                            break;
                        }

                        case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.ScalableDictionaryValues:
                        {
                            ScalableDictionaryValues scalableDictionaryValues = scalableDictionaryEntry as ScalableDictionaryValues;
                            if (this.m_currentValueIndex < scalableDictionaryValues.Count)
                            {
                                this.m_currentPair = new KeyValuePair <TKey, TValue>((TKey)scalableDictionaryValues.Keys[this.m_currentValueIndex], (TValue)scalableDictionaryValues.Values[this.m_currentValueIndex]);
                                this.m_currentValueIndex++;
                                return(true);
                            }
                            this.m_currentValueIndex = 0;
                            break;
                        }

                        default:
                            Global.Tracer.Assert(false, "Unknown ObjectType");
                            break;
                        }
                    }
                    curContext.Key++;
                }
                if (!flag)
                {
                    this.m_currentValueIndex = 0;
                    this.m_context.Pop();
                }
                return(flag);
            }
        private bool Find(ScalableDictionaryNodeReference nodeRef, int hashCode, TKey key, int level, out TValue value, out IDisposable containingNodeRef)
        {
            containingNodeRef = null;
            IDisposable            disposable             = nodeRef.PinValue();
            ScalableDictionaryNode scalableDictionaryNode = nodeRef.Value();

            value = default(TValue);
            bool result = false;
            int  num    = this.HashToSlot(scalableDictionaryNode, hashCode, level);
            IScalableDictionaryEntry scalableDictionaryEntry = scalableDictionaryNode.Entries[num];

            if (scalableDictionaryEntry != null)
            {
                switch (scalableDictionaryEntry.GetObjectType())
                {
                case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.ScalableDictionaryNodeReference:
                {
                    ScalableDictionaryNodeReference nodeRef2 = scalableDictionaryEntry as ScalableDictionaryNodeReference;
                    result = this.Find(nodeRef2, hashCode, key, level + 1, out value, out containingNodeRef);
                    break;
                }

                case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.ScalableDictionaryValues:
                {
                    ScalableDictionaryValues scalableDictionaryValues = scalableDictionaryEntry as ScalableDictionaryValues;
                    for (int i = 0; i < scalableDictionaryValues.Count; i++)
                    {
                        if (this.m_comparer.Equals(key, (TKey)scalableDictionaryValues.Keys[i]))
                        {
                            value             = (TValue)scalableDictionaryValues.Values[i];
                            containingNodeRef = disposable;
                            return(true);
                        }
                    }
                    break;
                }

                default:
                    Global.Tracer.Assert(false, "Unknown ObjectType");
                    break;
                }
            }
            disposable.Dispose();
            return(result);
        }
예제 #8
0
        public bool TryCreateReference(AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType referenceObjectType, out BaseReference reference)
        {
            switch (referenceObjectType)
            {
            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.Null:
            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.None:
                Global.Tracer.Assert(false, "Cannot create reference to Nothing or Null");
                reference = null;
                return(false);

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.StorableArrayReference:
                reference = new SimpleReference <StorableArray>(referenceObjectType);
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.ScalableDictionaryNodeReference:
                reference = new ScalableDictionaryNodeReference();
                break;

            default:
                reference = null;
                return(false);
            }
            return(true);
        }
        public bool TryCreateReference(AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType referenceObjectType, out BaseReference reference)
        {
            switch (referenceObjectType)
            {
            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.Null:
            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.None:
                Global.Tracer.Assert(false, "Cannot create reference to Nothing or Null");
                reference = null;
                return(false);

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeTablixCellReference:
                reference = new RuntimeTablixCellReference();
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeCellReference:
                reference = new RuntimeCellReference();
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeDetailObjReference:
                reference = new RuntimeDetailObjReference();
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeDataTablixObjReference:
                reference = new RuntimeDataTablixObjReference();
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeHierarchyObjReference:
                reference = new RuntimeHierarchyObjReference();
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeDataRegionObjReference:
                reference = new RuntimeDataRegionObjReference();
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeDataTablixGroupRootObjReference:
                reference = new RuntimeDataTablixGroupRootObjReference();
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeGroupRootObjReference:
                reference = new RuntimeGroupRootObjReference();
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeGroupObjReference:
                reference = new RuntimeGroupObjReference();
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeTablixGroupLeafObjReference:
                reference = new RuntimeTablixGroupLeafObjReference();
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeChartCriGroupLeafObjReference:
                reference = new RuntimeChartCriGroupLeafObjReference();
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeDataTablixGroupLeafObjReference:
                reference = new RuntimeDataTablixGroupLeafObjReference();
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeGroupLeafObjReference:
                reference = new RuntimeGroupLeafObjReference();
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeOnDemandDataSetObjReference:
                reference = new RuntimeOnDemandDataSetObjReference();
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeSortHierarchyObjReference:
                reference = new RuntimeSortHierarchyObjReference();
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeTablixObjReference:
                reference = new RuntimeTablixObjReference();
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeChartObjReference:
                reference = new RuntimeChartObjReference();
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeGaugePanelObjReference:
                reference = new RuntimeGaugePanelObjReference();
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeMapDataRegionObjReference:
                reference = new RuntimeMapDataRegionObjReference();
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeCriObjReference:
                reference = new RuntimeCriObjReference();
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.AggregateRowReference:
                reference = new SimpleReference <AggregateRow>(referenceObjectType);
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.DataAggregateReference:
                reference = new SimpleReference <AspNetCore.ReportingServices.ReportIntermediateFormat.DataAggregate>(referenceObjectType);
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.DataAggregateObjReference:
                reference = new SimpleReference <AspNetCore.ReportingServices.ReportIntermediateFormat.DataAggregateObj>(referenceObjectType);
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.DataFieldRowReference:
                reference = new SimpleReference <DataFieldRow>(referenceObjectType);
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.IHierarchyObjReference:
                reference = new SimpleReference <IHierarchyObj>(referenceObjectType);
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeCellsReference:
                reference = new SimpleReference <RuntimeCells>(referenceObjectType);
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeChartCriCellReference:
                reference = new RuntimeChartCriCellReference();
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeChartCriObjReference:
                reference = new RuntimeChartCriObjReference();
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeDataTablixMemberObjReference:
                reference = new RuntimeDataTablixMemberObjReference();
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeGroupingObjReference:
                reference = new SimpleReference <RuntimeGroupingObj>(referenceObjectType);
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeMemberObjReference:
                reference = new RuntimeMemberObjReference();
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeRDLDataRegionObjReference:
                reference = new SimpleReference <RuntimeRDLDataRegionObj>(referenceObjectType);
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeRICollectionReference:
                reference = new SimpleReference <RuntimeRICollection>(referenceObjectType);
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeSortFilterEventInfoReference:
                reference = new SimpleReference <AspNetCore.ReportingServices.OnDemandProcessing.TablixProcessing.RuntimeSortFilterEventInfo>(referenceObjectType);
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.RuntimeUserSortTargetInfoReference:
                reference = new SimpleReference <AspNetCore.ReportingServices.OnDemandProcessing.TablixProcessing.RuntimeUserSortTargetInfo>(referenceObjectType);
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.SortExpressionScopeInstanceHolderReference:
                reference = new SortExpressionScopeInstanceHolderReference();
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.SortFilterExpressionScopeObjReference:
                reference = new SortFilterExpressionScopeObjReference();
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.StorableArrayReference:
                reference = new SimpleReference <StorableArray>(referenceObjectType);
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.ScalableDictionaryNodeReference:
                reference = new ScalableDictionaryNodeReference();
                break;

            case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.LookupTableReference:
                reference = new SimpleReference <LookupTable>(referenceObjectType);
                break;

            default:
                reference = null;
                return(false);
            }
            return(true);
        }
        private bool Remove(ScalableDictionaryNodeReference nodeRef, int hashCode, TKey key, int level, out int newCount)
        {
            using (nodeRef.PinValue())
            {
                ScalableDictionaryNode scalableDictionaryNode = nodeRef.Value();
                bool flag = false;
                int  num  = this.HashToSlot(scalableDictionaryNode, hashCode, level);
                IScalableDictionaryEntry scalableDictionaryEntry = scalableDictionaryNode.Entries[num];
                if (scalableDictionaryEntry == null)
                {
                    flag = false;
                }
                else
                {
                    switch (scalableDictionaryEntry.GetObjectType())
                    {
                    case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.ScalableDictionaryNodeReference:
                    {
                        ScalableDictionaryNodeReference scalableDictionaryNodeReference = scalableDictionaryEntry as ScalableDictionaryNodeReference;
                        int num4 = default(int);
                        flag = this.Remove(scalableDictionaryNodeReference, hashCode, key, level + 1, out num4);
                        if (flag && num4 == 0)
                        {
                            scalableDictionaryNode.Entries[num] = null;
                            scalableDictionaryNodeReference.Free();
                        }
                        break;
                    }

                    case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.ScalableDictionaryValues:
                    {
                        ScalableDictionaryValues scalableDictionaryValues = scalableDictionaryEntry as ScalableDictionaryValues;
                        int num2 = 0;
                        while (num2 < scalableDictionaryValues.Count)
                        {
                            if (!this.m_comparer.Equals(key, (TKey)scalableDictionaryValues.Keys[num2]))
                            {
                                num2++;
                                continue;
                            }
                            if (scalableDictionaryValues.Count == 1)
                            {
                                scalableDictionaryNode.Entries[num] = null;
                            }
                            else
                            {
                                scalableDictionaryValues.Keys[num2]   = null;
                                scalableDictionaryValues.Values[num2] = null;
                                scalableDictionaryValues.Count--;
                                int num3 = scalableDictionaryValues.Count - num2;
                                if (num3 > 0)
                                {
                                    Array.Copy(scalableDictionaryValues.Keys, num2 + 1, scalableDictionaryValues.Keys, num2, num3);
                                    Array.Copy(scalableDictionaryValues.Values, num2 + 1, scalableDictionaryValues.Values, num2, num3);
                                }
                            }
                            flag = true;
                            break;
                        }
                        break;
                    }

                    default:
                        Global.Tracer.Assert(false, "Unknown ObjectType");
                        break;
                    }
                }
                if (flag)
                {
                    scalableDictionaryNode.Count--;
                }
                newCount = scalableDictionaryNode.Count;
                return(flag);
            }
        }
        private bool Insert(ScalableDictionaryNodeReference nodeRef, int hashCode, TKey key, TValue value, bool add, int level, bool updateSize, out IDisposable cleanupRef)
        {
            IDisposable            disposable             = nodeRef.PinValue();
            ScalableDictionaryNode scalableDictionaryNode = nodeRef.Value();
            bool flag = false;
            int  num  = this.HashToSlot(scalableDictionaryNode, hashCode, level);
            IScalableDictionaryEntry scalableDictionaryEntry = scalableDictionaryNode.Entries[num];

            if (scalableDictionaryEntry == null)
            {
                ScalableDictionaryValues scalableDictionaryValues = new ScalableDictionaryValues(this.m_valuesCapacity);
                scalableDictionaryValues.Keys[0]   = key;
                scalableDictionaryValues.Values[0] = value;
                scalableDictionaryValues.Count++;
                scalableDictionaryNode.Entries[num] = scalableDictionaryValues;
                flag       = true;
                cleanupRef = disposable;
                if (!this.m_useFixedReferences && updateSize)
                {
                    int sizeBytesDelta = ItemSizes.SizeOfInObjectArray(key) + ItemSizes.SizeOfInObjectArray(value) + scalableDictionaryValues.EmptySize;
                    nodeRef.UpdateSize(sizeBytesDelta);
                }
            }
            else
            {
                switch (scalableDictionaryEntry.GetObjectType())
                {
                case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.ScalableDictionaryNodeReference:
                {
                    ScalableDictionaryNodeReference nodeRef2 = scalableDictionaryEntry as ScalableDictionaryNodeReference;
                    flag = this.Insert(nodeRef2, hashCode, key, value, add, level + 1, updateSize, out cleanupRef);
                    break;
                }

                case AspNetCore.ReportingServices.ReportIntermediateFormat.Persistence.ObjectType.ScalableDictionaryValues:
                {
                    ScalableDictionaryValues scalableDictionaryValues2 = scalableDictionaryEntry as ScalableDictionaryValues;
                    bool flag2 = false;
                    cleanupRef = null;
                    int num2 = 0;
                    while (num2 < scalableDictionaryValues2.Count)
                    {
                        if (!this.m_comparer.Equals(key, (TKey)scalableDictionaryValues2.Keys[num2]))
                        {
                            num2++;
                            continue;
                        }
                        if (add)
                        {
                            Global.Tracer.Assert(false, "ScalableDictionary: An element with the same key already exists within the Dictionary");
                        }
                        scalableDictionaryValues2.Values[num2] = value;
                        flag2      = true;
                        flag       = false;
                        cleanupRef = disposable;
                        break;
                    }
                    if (!flag2)
                    {
                        if (scalableDictionaryValues2.Count < scalableDictionaryValues2.Capacity)
                        {
                            int count = scalableDictionaryValues2.Count;
                            scalableDictionaryValues2.Keys[count]   = key;
                            scalableDictionaryValues2.Values[count] = value;
                            scalableDictionaryValues2.Count++;
                            flag       = true;
                            cleanupRef = disposable;
                            if (!this.m_useFixedReferences && updateSize)
                            {
                                nodeRef.UpdateSize(ItemSizes.SizeOfInObjectArray(key));
                                nodeRef.UpdateSize(ItemSizes.SizeOfInObjectArray(value));
                            }
                        }
                        else
                        {
                            ScalableDictionaryNodeReference scalableDictionaryNodeReference = this.BuildNode(level + 1, this.m_nodeCapacity);
                            scalableDictionaryNode.Entries[num] = scalableDictionaryNodeReference;
                            using (scalableDictionaryNodeReference.PinValue())
                            {
                                if (!this.m_useFixedReferences && updateSize)
                                {
                                    int num3 = ItemSizes.SizeOfInObjectArray(scalableDictionaryValues2);
                                    nodeRef.UpdateSize(num3 * -1);
                                    scalableDictionaryNodeReference.UpdateSize(num3);
                                }
                                for (int i = 0; i < scalableDictionaryValues2.Count; i++)
                                {
                                    TKey        key2        = (TKey)scalableDictionaryValues2.Keys[i];
                                    IDisposable disposable2 = default(IDisposable);
                                    this.Insert(scalableDictionaryNodeReference, this.GetHashCode(key2), key2, (TValue)scalableDictionaryValues2.Values[i], false, level + 1, false, out disposable2);
                                    disposable2.Dispose();
                                }
                                flag = this.Insert(scalableDictionaryNodeReference, hashCode, key, value, add, level + 1, updateSize, out cleanupRef);
                            }
                        }
                    }
                    break;
                }

                default:
                    Global.Tracer.Assert(false, "Unknown ObjectType");
                    cleanupRef = null;
                    break;
                }
            }
            if (flag)
            {
                scalableDictionaryNode.Count++;
            }
            if (disposable != cleanupRef)
            {
                disposable.Dispose();
            }
            return(flag);
        }
 public void TransferTo(IScalabilityCache scaleCache)
 {
     this.m_root             = (ScalableDictionaryNodeReference)this.m_root.TransferTo(scaleCache);
     this.m_scalabilityCache = scaleCache;
 }