コード例 #1
0
        public void Add(uint handle, T value)
        {
            T t;

            if ((ulong)handle < (long)((int)this.fastSegment.Length))
            {
                if (this.fastSegment[handle] != null)
                {
                    throw new AmqpException(AmqpError.HandleInUse, SRAmqp.AmqpHandleInUse(handle, this.fastSegment[handle]));
                }
                this.fastSegment[handle] = value;
                return;
            }
            if (this.slowSegment == null)
            {
                this.slowSegment = new Dictionary <uint, T>();
            }
            else if (this.slowSegment.TryGetValue(handle, out t))
            {
                throw new AmqpException(AmqpError.HandleInUse, SRAmqp.AmqpHandleInUse(handle, t));
            }
            this.slowSegment.Add(handle, value);
        }