public Response<Portfolio> AddPortfolioItem(string portfolioID, string itemID)
 {
     Html2XmlDownload html = new Html2XmlDownload();
     html.Settings.Account = this;
     html.Settings.Url = string.Format("http://finance.yahoo.com/portfolio/add_symbols?portfolio_id={0}&portfolio_view_id=v1&quotes={1}", portfolioID, itemID);
     Response<XDocument> resp = html.Download();
     return ((DefaultResponse<XDocument>)resp).CreateNew(new PortfolioDownload().ConvertHtmlDoc(resp.Result));
 }
        public Response <Portfolio> AddPortfolioItem(string portfolioID, string itemID)
        {
            Html2XmlDownload html = new Html2XmlDownload();

            html.Settings.Account = this;
            html.Settings.Url     = string.Format("http://finance.yahoo.com/portfolio/add_symbols?portfolio_id={0}&portfolio_view_id=v1&quotes={1}", portfolioID, itemID);
            Response <XParseDocument> resp = html.Download();

            return(((DefaultResponse <XParseDocument>)resp).CreateNew(new PortfolioDownload().ConvertHtmlDoc(resp.Result)));
        }
 /// <summary>
 /// Logging out.
 /// </summary>
 /// <returns>The Logging</returns>
 public bool LogOut()
 {
     if (this.IsLoggedIn)
     {
         Html2XmlDownload dl = new Html2XmlDownload();
         dl.Settings.Account = this;
         dl.Settings.DownloadStream = false;
         dl.Settings.Url = "http://login.yahoo.com/config/login?logout=1&.direct=2&.done=&.src=&.intl=us&.lang=en-US";
         dl.AsyncDownloadCompleted += this.LogOutAsync_Completed;
         Response<XDocument> resp = dl.Download();
         if (resp.Connection.State == ConnectionState.Success)
         {
             mCookies = null;
             this.SetCrumb(string.Empty);
             if (this.PropertyChanged != null) this.PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs("IsLoggedIn"));
         }               
     }
     return this.IsLoggedIn;
 }
 /// <summary>
 /// Logging out.
 /// </summary>
 /// <returns>The Logging</returns>
 public bool LogOut()
 {
     if (this.IsLoggedIn)
     {
         Html2XmlDownload dl = new Html2XmlDownload();
         dl.Settings.Account        = this;
         dl.Settings.DownloadStream = false;
         dl.Settings.Url            = "http://login.yahoo.com/config/login?logout=1&.direct=2&.done=&.src=&.intl=us&.lang=en-US";
         dl.AsyncDownloadCompleted += this.LogOutAsync_Completed;
         Response <XDocument> resp = dl.Download();
         if (resp.Connection.State == ConnectionState.Success)
         {
             mCookies = null;
             this.SetCrumb(string.Empty);
             if (this.PropertyChanged != null)
             {
                 this.PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs("IsLoggedIn"));
             }
         }
     }
     return(this.IsLoggedIn);
 }
 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;
     }
 }