public static bool TryCreateFromResponseHeaders(WebHeaderCollection webHeaderCollection, out RequestFailureContext requestFailureContext)
 {
     if (webHeaderCollection == null)
     {
         throw new ArgumentNullException("webHeaderCollection");
     }
     return(RequestFailureContext.TryDeserialize(webHeaderCollection[RequestFailureContext.HeaderKey], out requestFailureContext));
 }
        public static bool TryCreateFromResponseHeaders(IDictionary <string, string> headerDictionary, out RequestFailureContext requestFailureContext)
        {
            if (headerDictionary == null)
            {
                throw new ArgumentNullException("headerDictionary");
            }
            requestFailureContext = null;
            string headerValue;

            return(headerDictionary.TryGetValue(RequestFailureContext.HeaderKey, out headerValue) && RequestFailureContext.TryDeserialize(headerValue, out requestFailureContext));
        }