示例#1
0
        private void AddPortfolioItem_Completed(DownloadClient <XParseDocument> sender, DownloadCompletedEventArgs <XParseDocument> e)
        {
            AddPfItemAsyncArgs args = (AddPfItemAsyncArgs)e.UserArgs;
            Portfolio          pf   = new PortfolioDownload().ConvertHtmlDoc(e.Response.Result);

            if (this.AsyncAddPortfolioItemCompleted != null)
            {
                this.AsyncAddPortfolioItemCompleted(this, ((DefaultDownloadCompletedEventArgs <XParseDocument>)e).CreateNew(pf));
            }
        }
示例#2
0
        private void DeletePortfolioView_DownloadCompleted(WebFormUpload sender, DefaultDownloadCompletedEventArgs <XParseDocument> e)
        {
            sender.AsyncUploadCompleted -= this.DeletePortfolioView_DownloadCompleted;
            Portfolio pf = new PortfolioDownload().ConvertHtmlDoc(e.Response.Result);

            if (this.AsyncDeletePortfolioViewCompleted != null)
            {
                this.AsyncDeletePortfolioViewCompleted(this, e.CreateNew <Portfolio>(pf));
            }
        }
 public Response <Portfolio> DownloadPortfolio(string portfolioID, int viewIndex)
 {
     if (this.IsLoggedIn)
     {
         PortfolioDownload dl = new PortfolioDownload();
         dl.Settings.Account     = this;
         dl.Settings.ViewIndex   = viewIndex;
         dl.Settings.PortfolioID = portfolioID;
         return(dl.Download());
     }
     else
     {
         throw new NotSupportedException("The user is not logged in.");
     }
 }
示例#4
0
 public void DownloadPortfolioAsync(PortfolioInfo portfolio, int viewIndex, bool dlRealTime, bool dlFundamentals, object userArgs)
 {
     if (this.IsLoggedIn)
     {
         PortfolioDownload dl = new PortfolioDownload();
         dl.Settings.Account     = this;
         dl.Settings.ViewIndex   = viewIndex;
         dl.Settings.PortfolioID = portfolio.ID;
         dl.Settings.DownloadFundamentalsView = dlFundamentals;
         dl.Settings.DownloadRealTimeView     = dlRealTime;
         dl.AsyncDownloadCompleted           += this.PortfolioDownload_DownloadCompleted;
         dl.DownloadAsync(userArgs);
     }
     else
     {
         throw new NotSupportedException("The user is not logged in.");
     }
 }