Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
        private void RaiseNewPortfolio(Portfolio portfolio)
        {
            NewPortfolio.SafeInvoke(portfolio);

            var multiEvt = NewPortfolios;

            if (multiEvt == null)
            {
                return;
            }

            multiEvt.SafeInvoke(new[] { portfolio });
        }
Exemplo n.º 3
0
        //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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 internal void OnAddPortfolio(int row, int rowCount, string name, string exchange, SmartPortfolioStatus status)
 {
     NewPortfolio.SafeInvoke(row, rowCount, name, exchange, status);
 }
Exemplo n.º 6
0
 private void RaiseNewPortfolio(Portfolio portfolio)
 {
     NewPortfolio?.Invoke(portfolio);
     NewPortfolios?.Invoke(new[] { portfolio });
 }
Exemplo n.º 7
0
 private void NewPortfolioHandler(Portfolio portfolio)
 {
     AddGuiAction(() => NewPortfolio.SafeInvoke(portfolio));
 }