Beispiel #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);
            }
        }
Beispiel #2
0
        public void UploadAsync(WebFormDownloadSettings settings, object userArgs)
        {
            AsyncArgs args = new AsyncArgs(userArgs)
            {
                Settings = settings
            };

            if (settings.Account.Crumb == string.Empty)
            {
                Html2XmlDownload html = new Html2XmlDownload();
                html.Settings.Account        = settings.Account;
                html.Settings.Url            = settings.Url;
                html.AsyncDownloadCompleted += this.html_DownloadAsyncCompleted;
                html.DownloadAsync(args);
            }
            else
            {
                this.UploadAsync2(args);
            }
        }
Beispiel #3
0
 public WebFormUpload()
 {
     this.Settings = new WebFormDownloadSettings();
 }