GetCacheControlLength() static private method

static private GetCacheControlLength ( string input, int startIndex, CacheControlHeaderValue storeValue, CacheControlHeaderValue &parsedValue ) : int
input string
startIndex int
storeValue CacheControlHeaderValue
parsedValue CacheControlHeaderValue
return int
Ejemplo n.º 1
0
        protected override int GetParsedValueLength(string value, int startIndex, object?storeValue,
                                                    out object?parsedValue)
        {
            CacheControlHeaderValue?temp = null;
            bool isInvalidValue          = true;

            if (storeValue is List <object> list)
            {
                foreach (object item in list)
                {
                    if (item is not HttpHeaders.InvalidValue)
                    {
                        isInvalidValue = false;
                        temp           = item as CacheControlHeaderValue;
                        break;
                    }
                }
            }
            else
            {
                if (storeValue is not HttpHeaders.InvalidValue)
                {
                    isInvalidValue = false;
                    temp           = storeValue as CacheControlHeaderValue;
                }
            }
            Debug.Assert(isInvalidValue || storeValue == null || temp != null, "'storeValue' is not of type CacheControlHeaderValue");

            int resultLength = CacheControlHeaderValue.GetCacheControlLength(value, startIndex, temp, out temp);

            parsedValue = temp;
            return(resultLength);
        }
Ejemplo n.º 2
0
        protected override int GetParsedValueLength(string value, int startIndex, object storeValue,
                                                    out object parsedValue)
        {
            CacheControlHeaderValue temp = storeValue as CacheControlHeaderValue;

            Debug.Assert(storeValue == null || temp != null, "'storeValue' is not of type CacheControlHeaderValue");

            int resultLength = CacheControlHeaderValue.GetCacheControlLength(value, startIndex, temp, out temp);

            parsedValue = temp;
            return(resultLength);
        }