当前位置: 首页>>代码示例>>C#>>正文


C# FacebookClient.DeleteTaskAsync方法代码示例

本文整理汇总了C#中Facebook.FacebookClient.DeleteTaskAsync方法的典型用法代码示例。如果您正苦于以下问题:C# FacebookClient.DeleteTaskAsync方法的具体用法?C# FacebookClient.DeleteTaskAsync怎么用?C# FacebookClient.DeleteTaskAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Facebook.FacebookClient的用法示例。


在下文中一共展示了FacebookClient.DeleteTaskAsync方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: API

        /// <summary>
        /// For platforms that do not support dynamic cast it to either IDictionary<string, object> if json object or IList<object> if array.
        /// For primitive types cast it to bool, string, dobule or long depending on the type.
        /// Reference: http://facebooksdk.net/docs/making-asynchronous-requests/#1
        /// </summary>
        public static void API(
            string endpoint,
            HttpMethod method,
            FacebookDelegate callback,
            object parameters = null)
        {
#if NETFX_CORE

            Task.Run(async () =>
            {
                FacebookClient fb = new FacebookClient(_fbSessionClient.CurrentAccessTokenData.AccessToken);
                FBResult fbResult = null;
                try
                {
                    object apiCall;
                    if (method == HttpMethod.GET)
                    {
                        apiCall = await fb.GetTaskAsync(endpoint, parameters);
                    }
                    else if (method == HttpMethod.POST)
                    {
                        apiCall = await fb.PostTaskAsync(endpoint, parameters);
                    }
                    else
                    {
                        apiCall = await fb.DeleteTaskAsync(endpoint);
                    }
                    if (apiCall != null)
                    {
                        fbResult = new FBResult();
                        fbResult.Text = apiCall.ToString();
                        fbResult.Json = apiCall as JsonObject;
                    }
                }
                catch (Exception ex)
                {
                    fbResult = new FBResult();
                    fbResult.Error = ex.Message;
                }
                if (callback != null)
                {
                    Dispatcher.InvokeOnAppThread(() => { callback(fbResult); });
                }
            });
#else
            throw new PlatformNotSupportedException("");
#endif
        }
开发者ID:khaerul10056,项目名称:MarkerMetro.Unity.WinIntegration,代码行数:53,代码来源:FBNative.cs

示例2: UnlinkFaceBook

 public async void UnlinkFaceBook()
 {
     if(!HasConnection || UserPreference.AccessKey==null)
         return; 
     var fb = new FacebookClient(UserPreference.AccessKey) { AppId = AppId };
     await fb.DeleteTaskAsync(string.Format("https://graph.facebook.com/{0}/permissions", UserPreference.FbUserId));
     UserPreference.AccessKey = null;
     UserPreference.FbUserId = null;
     UserPreference.Name = null;
     SaveSettings();
     NotifyPropertyChanged("AccessKey");
 }
开发者ID:peterdocter,项目名称:hydra,代码行数:12,代码来源:MainViewModel.cs

示例3: DeleteFacebookRequestAsync

 public Task<object> DeleteFacebookRequestAsync(string requestId, long userId, string accessToken)
 {
     string final = string.Format("{0}_{1}", requestId, userId);
     var fb = new FacebookClient(accessToken);
     return fb.DeleteTaskAsync(final);
 }
开发者ID:jorik041,项目名称:VerseEngineering,代码行数:6,代码来源:FacebookProfileProxy.cs


注:本文中的Facebook.FacebookClient.DeleteTaskAsync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。