/// <summary> /// Add security. /// </summary> /// <param name="portfolio">Portfolio.</param> public void Add(Portfolio portfolio) { if (portfolio is null) { throw new ArgumentNullException(nameof(portfolio)); } _inner.Add(portfolio.Name, portfolio); NewPortfolio?.Invoke(portfolio); }
private void RaiseNewPortfolio(Portfolio portfolio) { NewPortfolio.SafeInvoke(portfolio); var multiEvt = NewPortfolios; if (multiEvt == null) { return; } multiEvt.SafeInvoke(new[] { portfolio }); }
//Returns the portfolio name and starting account balance public NewPortfolio GetPortfolio() { NewPortfolio ret = new NewPortfolio(); if (ShowDialog() == DialogResult.OK) { ret.PortfolioName = txtName.Text.Trim(); try{ ret.StartingBalance = Convert.ToDouble(txtBalance.Text.Trim()); } catch { } } return(ret); }
public void GetPortfolios() { string endPoint = "payment/balances"; var res = SendQuery(true, endPoint, _pubKey, _secKey); List <Balance> balances = JsonConvert.DeserializeAnonymousType(res, new List <Balance>()); BalanceInfo balanceInfo = new BalanceInfo(); balanceInfo.Balances = balances; balanceInfo.Name = _portfolioName; NewPortfolio?.Invoke(balanceInfo); }
internal void OnAddPortfolio(int row, int rowCount, string name, string exchange, SmartPortfolioStatus status) { NewPortfolio.SafeInvoke(row, rowCount, name, exchange, status); }
private void RaiseNewPortfolio(Portfolio portfolio) { NewPortfolio?.Invoke(portfolio); NewPortfolios?.Invoke(new[] { portfolio }); }
private void NewPortfolioHandler(Portfolio portfolio) { AddGuiAction(() => NewPortfolio.SafeInvoke(portfolio)); }