Facebook.FacebookOAuthClient.OAuthRequestAsync C# (CSharp) Method

OAuthRequestAsync() protected method

protected OAuthRequestAsync ( string name, string path, object>.IDictionary parameters, object userToken, string>.Func processResponseString, FacebookApiEventArgs>.Action onDownloadComplete ) : void
name string
path string
parameters object>.IDictionary
userToken object
processResponseString string>.Func
onDownloadComplete FacebookApiEventArgs>.Action
return void
        internal protected virtual void OAuthRequestAsync(string name, string path, IDictionary<string, object> parameters, object userToken, Func<string, string> processResponseString, Action<object, FacebookApiEventArgs> onDownloadComplete)
        {
            Contract.Requires(!String.IsNullOrEmpty(name));
            Contract.Requires(onDownloadComplete != null);

            var mergedParameters = FacebookUtils.Merge(null, parameters);

            path = FacebookUtils.ParseQueryParametersToDictionary(path, mergedParameters);

            if (!string.IsNullOrEmpty(path) && path.StartsWith("/", StringComparison.OrdinalIgnoreCase))
            {
                path = path.Substring(1, path.Length - 1);
            }

            var requestUrl = GetUrl(name, path, parameters);

            var webClient = WebClient;

            var tempState = new WebClientStateContainer
            {
                UserState = userToken,
                Method = HttpMethod.Get,
                RequestUri = requestUrl
            };

            webClient.DownloadDataCompleted = (o, e) => DownloadDataCompleted(o, e, processResponseString, onDownloadComplete);

            webClient.DownloadDataAsync(requestUrl, tempState);
        }