Example #1
0
        private async Task MakeFeed(UriType type, HttpContent content)
        {
            try
            {
                object[] arg = Array.Empty <object>();
                if (type != UriType.CreateFeed)
                {
                    arg = new object[] { FeedId };
                }
                var(r, _) = await DataHelper.PostDataAsync(UriHelper.GetUri(type, arg), content);

                if (r)
                {
                    SendSuccessful();
                }
            }
            catch (Core.Exceptions.CoolapkMessageException cex)
            {
                UIHelper.ShowMessage(cex.Message);
                if (cex.MessageStatus == Core.Exceptions.CoolapkMessageException.RequestCaptcha)
                {
                    var dialog = new CaptchaDialog();
                    await dialog.ShowAsync();
                }
            }
        }
 private async Task MakeFeed(DataUriType type, HttpMultipartFormDataContent content)
 {
     try
     {
         if (type == DataUriType.CreateFeed)
         {
             if (await DataHelper.PostDataAsync(type, content) != null)
             {
                 SendSuccessful();
             }
         }
         else
         {
             if (await DataHelper.PostDataAsync(type, content, FeedId) != null)
             {
                 SendSuccessful();
             }
         }
     }
     catch (CoolapkMessageException cex)
     {
         UIHelper.ShowMessage(cex.Message);
         if (cex.MessageStatus == CoolapkMessageException.RequestCaptcha)
         {
             var dialog = new CaptchaDialog();
             await dialog.ShowAsync();
         }
     }
 }