private void facebook_LoggedOut(object sender, EventArgs e)
        {
            facebook = new Facebook();

            btnSearchUser.IsEnabled = false;
            btnSendMessage.IsEnabled = false;
            btnStopListening.IsEnabled = false;
            btnCreateGroup.IsEnabled = false;
        }
 public MainWindow()
 {
     InitializeComponent();
     facebook = new Facebook();
     facebook.LoggedIn += facebook_LoggedIn;
     facebook.FailedLogin += facebook_FailedLogin;
     facebook.LoggedOut += facebook_LoggedOut;
     facebook.MessageSent += facebook_MessageSent;
     facebook.MessageReceived += facebook_MessageReceived;
     facebook.FileMessageReceived += facebook_FileMessageReceived;
     facebook.PhotoMessageReceived += facebook_PhotoMessageReceived;
     facebook.StickerMessageReceived += facebook_StickerMessageReceived;
     facebook.AnimatedImageMessageReceived += facebook_AnimatedImageMessageReceived;
     facebook.ShareMessageReceived += facebook_ShareMessageReceived;
     facebook.SearchUserCompleted += facebook_SearchUserCompleted;
     facebook.GroupCreated += facebook_GroupCreated;
     facebook.ThreadGet += facebook_ThreadGet;
     facebook.UserAddedToGroup += facebook_UserAddedToGroup;
     facebook.UserRemovedFromGroup += facebook_UserRemovedFromGroup;
 }
 private void facebook_MessageReceived(object sender, Facebook.MessageReceivedEventArgs e)
 {
     MessageBox.Show("RECEIVED Text message !\n Content : " + e.Message.Body);
 }
 private void facebook_MessageSent(object sender, Facebook.MessageSentEventArgs e)
 {
     MessageBox.Show(e.MessageID);
 }
 private void facebook_SearchUserCompleted(object sender, Facebook.SearchUserCompletedEventArgs e)
 {
     if (e.UserList.Count > 0)
         tbxSearchResult.Text = e.UserList[0].UserID;
 }
 private void facebook_ThreadGet(object sender, Facebook.ThreadGetEventArgs e)
 {
     Console.WriteLine(e.HasResult);
 }
        private void facebook_GroupCreated(object sender, Facebook.MessageSentEventArgs e)
        {

            tbxThreadID.Text = e.ThreadID;

        }
 private void facebook_ShareMessageReceived(object sender, Facebook.MessageReceivedEventArgs e)
 {
     Console.WriteLine("RECEIVED SHARE message !");
     Console.WriteLine(e.Message.ContainShareAttachments().ToString());
 }
 private void facebook_PhotoMessageReceived(object sender, Facebook.MessageReceivedEventArgs e)
 {
     Console.WriteLine("RECEIVED photo message!");
     Console.WriteLine(e.Message.ContainPhotoAttachments().ToString());
 }
 private void facebook_StickerMessageReceived(object sender, Facebook.MessageReceivedEventArgs e)
 {
     Console.WriteLine("RECEIVED sticker !");
     Console.WriteLine(e.Message.ContainStickerAttachments().ToString());
     Console.WriteLine(e.Message.Attachments.Count);
 }
 private void facebook_AnimatedImageMessageReceived(object sender, Facebook.MessageReceivedEventArgs e)
 {
     Console.WriteLine("RECEIVED ANIMATED IMAGE !");
     Console.WriteLine(e.Message.ContainAnimatedImageAttachments().ToString());
 }