Example #1
0
 private void button1_Click(object sender, RibbonControlEventArgs e)
 {
     if (ThisAddIn.GetAccessToken() == "")
     {
         try
         {
             FacebookClient fc = new FacebookClient();
             LoginForm l = new LoginForm(fc.GetLoginUrl(new
             {
                 client_id = ThisAddIn._appkey,
                 response_type = "token",
                 display = "touch",
                 redirect_uri = "https://www.facebook.com/connect/login_success.html",
                 scope = String.Join(",", PERMISSIONS)
             }).ToString(), this, true);
             l.Show();
         }
         catch (Exception ex)
         {
         }
     }
     else
     {
         var fb = new FacebookClient(ThisAddIn.GetAccessToken());
         dynamic me = fb.Get("me");
         var url = me.link;
         Process.Start(url);
     }
 }
Example #2
0
 private void button2_Click(object sender, RibbonControlEventArgs e)
 {
     FacebookClient fc = new FacebookClient();
     LoginForm l = new LoginForm(fc.GetLogoutUrl(new
     {
         next = "https://www.facebook.com/connect/login_success.html",
         access_token = ThisAddIn.GetAccessToken()
     }).ToString(), this, false);
     l.Show();
 }