예제 #1
0
        public ExpandRet ExpandPages_OrThrow(uint newPageSize, LimitsPaged limits, bool throwOnNoChange = false)
        {
            ExpandRet ret = this.ExpandPages(newPageSize, limits);

            this.ThrowErrorForExpandReturn(ret, throwOnNoChange);
            return(ret);
        }
예제 #2
0
        public ExpandRet ExpandEntries_OrThrow(uint newEntriesCt, LimitEntries limits, bool throwOnNoChange = false)
        {
            ExpandRet ret = this.ExpandEntries(newEntriesCt, limits);

            this.ThrowErrorForExpandReturn(ret, throwOnNoChange);
            return(ret);
        }
예제 #3
0
        private ExpandRet _ExpandInternal(uint newByteSize)
        {
            ExpandRet ret = this.__ExpandInternal(newByteSize);

            if (ret == ExpandRet.Successful)
            {
                fixed(byte *pb = this.data)
                {
                    this._pdata = pb;
                }
            }

            return(ret);
        }
예제 #4
0
        private void ThrowErrorForExpandReturn(ExpandRet ret, bool throwOnNoChange = false)
        {
            if (throwOnNoChange == true && ret == ExpandRet.Err_NoChange)
            {
                throw new System.Exception("Attempting to expand data store did not result in any change.");
            }

            if (ret == ExpandRet.Err_TooLarge)
            {
                throw new System.Exception("Attempting to expand data store larger than the maximum size.");
            }

            if (ret == ExpandRet.Err_TooSmall)
            {
                throw new System.Exception("Attempting to expand data store smaller than the minimum size.");
            }
        }