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


C# FacebookClient.DeleteAsync方法代码示例

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


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

示例1: DeleteLastMessage_Click

        private void DeleteLastMessage_Click(object sender, RoutedEventArgs e)
        {
            btnDeleteLastMessage.IsEnabled = false;

            var fb = new FacebookClient(_accessToken);

            // make sure to add event handler for DeleteCompleted.
            fb.DeleteCompleted += (o, args) =>
            {
                // incase you support cancellation, make sure to check
                // e.Cancelled property first even before checking (e.Error!=null).
                if (args.Cancelled)
                {
                    // for this example, we can ignore as we don't allow this
                    // example to be cancelled.

                    // you can check e.Error for reasons behind the cancellation.
                    var cancellationError = args.Error;
                }
                else if (args.Error != null)
                {
                    // error occurred
                    Dispatcher.BeginInvoke(
                        () =>
                        {
                            MessageBox.Show(args.Error.Message);
                        });
                }
                else
                {
                    // the request was completed successfully

                    // make sure to be on the right thread when working with ui.
                    Dispatcher.BeginInvoke(() =>
                                               {
                                                   MessageBox.Show("Message deleted successfully");
                                                   btnDeleteLastMessage.IsEnabled = false;
                                               });
                }
            };

            fb.DeleteAsync(_lastMessageId);
        }
开发者ID:bertvan,项目名称:facebook-csharp-sdk,代码行数:43,代码来源:FacebookInfoPage.xaml.cs

示例2: DeleteLastMessage_Click

        private void DeleteLastMessage_Click(object sender, RoutedEventArgs e)
        {
            btnDeleteLastMessage.IsEnabled = false;

            var fb = new FacebookClient(_accessToken);

            fb.DeleteCompleted += (o, args) =>
            {
                if (args.Error != null)
                {
                    Dispatcher.BeginInvoke(() => MessageBox.Show(args.Error.Message));
                    return;
                }

                Dispatcher.BeginInvoke(() =>
                {
                    MessageBox.Show("Message deleted successfully");
                    btnDeleteLastMessage.IsEnabled = false;
                });
            };

            fb.DeleteAsync(_lastMessageId);
        }
开发者ID:hmcaio,项目名称:facebook-windows-phone-sample,代码行数:23,代码来源:FacebookInfoPage.xaml.cs

示例3: DeletePost

        /// <summary>
        /// Delete post from wall of facebook user
        /// </summary>
        public void DeletePost()
        {
            var fb = new FacebookClient(_accessToken);

            fb.DeleteCompleted += (o, args) =>
                                      {
                                          if (args.Error != null)
                                          {
                                              Dispatcher.BeginInvoke(() => MessageBox.Show(args.Error.Message));
                                              return;
                                          }

                                          Dispatcher.BeginInvoke(() =>
                                                                     {
                                                                         MessageBox.Show("Message deleted successfully");
                                                                         btnDeletePost.IsEnabled = false;
                                                                     });
                                      };

            fb.DeleteAsync(_lastMessageId);  // delete message from wall
        }
开发者ID:pankajc-optimus,项目名称:windows-lib,代码行数:24,代码来源:InfoPage.xaml.cs


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