示例#1
0
 public Stock(string _Symbol, int _Price)
 {
     if (!StockUtilities.IsValidTicker(_Symbol))
     {
         throw new InvalidTicker();
     }
     Symbol            = _Symbol;
     Price             = _Price;
     Volume            = 0;
     OutstandingShares = 0;
 }
示例#2
0
 public bool AddStock(Stock stock)
 {
     if (!StockUtilities.IsValidTicker(stock.Symbol))
     {
         return(false);
     }
     if (StockList.ContainsKey(stock.Symbol))
     {
         return(false);
     }
     else
     {
         StockList.Add(stock.Symbol, stock);
         return(true);
     }
 }