Exemple #1
0
        public Response <XDocument> Upload(WebFormDownloadSettings settings)
        {
            AsyncArgs args = new AsyncArgs(null)
            {
                Settings = settings
            };

            if (settings.Account.Crumb == string.Empty)
            {
                Html2XmlDownload html = new Html2XmlDownload();
                html.Settings.Account = settings.Account;
                html.Settings.Url     = settings.Url;
                Response <XDocument> resp = html.Download();
                this.ConvertHtml(resp.Result, args);
            }
            PostDataUpload dl = new PostDataUpload();

            this.PrepareDownloader(dl, args);
            if (dl.Settings.PostStringData != string.Empty)
            {
                DefaultResponse <System.IO.Stream> resp = (DefaultResponse <System.IO.Stream>)dl.Download();
                return(resp.CreateNew(MyHelper.ParseXmlDocument(resp.Result)));
            }
            else
            {
                return(null);
            }
        }
 public Response <PortfolioInfoResult> DeletePortfolio(string portfolioID)
 {
     if (this.IsLoggedIn)
     {
         WebFormUpload upl = new WebFormUpload();
         DefaultResponse <XParseDocument> resp = (DefaultResponse <XParseDocument>)upl.Upload(this.GetDeletePortfolioDownloadSettings(portfolioID));
         return(resp.CreateNew(new PortfolioInfoDownload().ConvertHtml(resp.Result)));
     }
     else
     {
         throw new NotSupportedException("The user is not logged in.");
     }
 }