コード例 #1
0
 public void ClearState(
     XboxLiveAPIName xboxLiveApi
     )
 {
     lock (instanceLock)
     {
         this.apiStateMap.Remove(xboxLiveApi);
     }
 }
コード例 #2
0
 public bool GetState(
     XboxLiveAPIName xboxLiveApi,
     out HttpRetryAfterApiState returnValue
     )
 {
     lock (instanceLock)
     {
         return(this.apiStateMap.TryGetValue(xboxLiveApi, out returnValue));
     }
 }
コード例 #3
0
 public void SetState(
     XboxLiveAPIName xboxLiveApi,
     HttpRetryAfterApiState state
     )
 {
     lock (instanceLock)
     {
         this.apiStateMap[xboxLiveApi] = state;
     }
 }
コード例 #4
0
        internal XboxLiveHttpResponse(
            int httpStatusCode,
            bool networkFailure,
            HttpWebResponse response,
            DateTime responseReceivedTime,
            DateTime requestStartTime,
            string xboxUserId,
            XboxLiveSettings contextSettings,
            string url,
            XboxLiveAPIName xboxLiveAPI,
            string method,
            string requestBody,
            HttpCallResponseBodyType responseBodyType
            )
        {
            this.HttpStatus           = httpStatusCode;
            this.NetworkFailure       = networkFailure;
            this.response             = response;
            this.ResponseReceivedTime = responseReceivedTime;
            this.RequestStartTime     = requestStartTime;
            this.XboxUserId           = xboxUserId;
            this.ContextSettings      = contextSettings;
            this.Url              = url;
            this.XboxLiveAPI      = xboxLiveAPI;
            this.Method           = method;
            this.RequestBody      = requestBody;
            this.ResponseBodyType = responseBodyType;

            if (response != null)
            {
                using (Stream body = response.GetResponseStream())
                {
                    this.Initialize((int)response.StatusCode, body, response.ContentLength, "utf-8", response.Headers);
                }
            }
        }