Exemplo n.º 1
0
        public void UpdateCacheCapacity(int index, CacheCapacity capacity)
        {
            if (capacity == null)
            {
                throw new NullReferenceException("capacity is null.");
            }

            if (index < 0 || index >= this.mediumConfigurationList.Count)
            {
                throw new IndexOutOfRangeException("index is out of range.");
            }

            this.mediumConfigurationList[index].UpdateCacheCapacity(capacity);
        }
Exemplo n.º 2
0
        public bool Equals(CacheCapacity cachecapacity)
        {
            if(this.Primary != cachecapacity.Primary)
            {
                return false;
            }

            switch (this.Primary)
            {
                case Primary.SIZEONLY:
                    if (this.Size == cachecapacity.Size)
                    {
                        return true;
                    }
                    break;
                case Primary.COUNTONLY:
                    if (this.Count == cachecapacity.Count)
                    {
                        return true;
                    }
                    break;
                case Primary.COUNTSIZE:
                    if (this.Count == cachecapacity.Count && this.Size == cachecapacity.Size)
                    {
                        return true;
                    }
                    break;
                case Primary.SIZECOUNT:
                    if (this.Count == cachecapacity.Count && this.Size == cachecapacity.Size)
                    {
                        return true;
                    }
                    break;
                default:
                    throw new NotSupportedException("Not support");
            }

            return false;
        }
Exemplo n.º 3
0
        public bool CountEquals(CacheCapacity cachecapacity)
        {
            if (this.Count == cachecapacity.Count)
            {
                return true;
            }

            return false;
        }
Exemplo n.º 4
0
        public bool SizeEquals(CacheCapacity cachecapacity)
        {
            if(this.Size == cachecapacity.Size)
            {
                return true;
            }

            return false;
        }