Esempio n. 1
0
 internal static async void Send(TweetInputInfo inputInfo)
 {
     await inputInfo.DeletePrevious();
     inputInfo.Send()
              .Subscribe(_ =>
              {
                  if (_.PostedTweets != null)
                  {
                      InputAreaModel.PreviousPosted = _;
                      BackstageModel.RegisterEvent(new PostSucceededEvent(_));
                  }
                  else
                  {
                      var result = AnalysisFailedReason(_);
                      if (result.Item1)
                          InputAreaModel.Drafts.Add(_);
                      BackstageModel.RegisterEvent(new PostFailedEvent(_, result.Item2));
                  }
              }, ex => Debug.WriteLine(ex));
 }
Esempio n. 2
0
 internal static void Send(TweetInputInfo inputInfo)
 {
     Task.Run(async () =>
     {
         await inputInfo.DeletePreviousAsync();
         inputInfo.Send()
                  .Subscribe(tweetInputInfo =>
                  {
                      if (tweetInputInfo.PostedTweets != null)
                      {
                          InputAreaModel.PreviousPosted = tweetInputInfo;
                          BackstageModel.RegisterEvent(new PostSucceededEvent(tweetInputInfo));
                      }
                      else
                      {
                          var result = AnalysisFailedReason(tweetInputInfo);
                          if (result.Item1)
                          {
                              InputAreaModel.Drafts.Add(tweetInputInfo);
                          }
                          BackstageModel.RegisterEvent(new PostFailedEvent(tweetInputInfo, result.Item2));
                      }
                  }, ex => Debug.WriteLine(ex));
     });
 }
Esempio n. 3
0
 internal static async void Send(TweetInputInfo inputInfo)
 {
     await inputInfo.DeletePrevious();
     inputInfo.Send()
              .Subscribe(_ =>
              {
                  Debug.WriteLine("Completed!");
                  if (_.PostedTweets != null)
                  {
                      InputAreaModel.PreviousPosted = _;
                      BackpanelModel.RegisterEvent(new PostSucceededEvent(_));
                  }
                  else
                  {
                      Tuple<bool, string> result = AnalysisFailedReason(_);
                      if (result.Item1)
                          InputAreaModel.Drafts.Add(_);
                      BackpanelModel.RegisterEvent(new PostFailedEvent(_, result.Item2));
                  }
              }, ex =>
              {
                  Debug.WriteLine("Exception is thrown...");
                  Debug.WriteLine(ex);
              });
 }