Ejemplo n.º 1
0
 public void Share(object propertiesObject)
 {
     if (!FbAccountLoggedIn)
     {
         try
         {
             BrowserWindow browser = new BrowserWindow();
             browserWindow = browser;
             webBrowser    = browser.webBrowser;
             browser.Show();
             var uri = GetLoginUrl();
             browser.webBrowser.Navigate(uri);
             browser.webBrowser.LoadCompleted += WebBrowser_LoadCompleted;
         }
         catch (Exception e)
         {
             MessageBox.Show("Unexpected error during web navigation: " + e.Message, "Navigation error");
         }
     }
     else
     {
         var parameters   = new Dictionary <string, object>();
         var recipeToPost = propertiesObject as Recipe;
         if (recipeToPost == null)
         {
             return;
         }
         parameters["message"] = recipeToPost.Description;
         try
         {
             FbClient.Post("me/feed", parameters);
             MessageBox.Show("Recipe posted.", "Post");
         }
         catch (Exception e)
         {
             MessageBox.Show("Unexpected error during post action: " + e.Message, "Post error");
         }
     }
 }
 public void Post(string action, object args)
 {
     FbClient.Post(action, args);
 }