Ejemplo n.º 1
0
 public ObservableCollection<StockWrapper> CreateCollection(IOStockType type)
 {
     if (type == IOStockType.NONE)
         throw new ArgumentOutOfRangeException();
     if (type == IOStockType.ALL)
         return new ObservableCollection<StockWrapper>(_list);
     else
         return new ObservableCollection<StockWrapper>(_list.Where(x => x.StockType == type));
 }
Ejemplo n.º 2
0
 public int Count(IOStockType type = IOStockType.ALL)
 {
     if (type == IOStockType.NONE)
         throw new ArgumentException();
     if (IOStockType.ALL == type)
         return _list.Count;
     else
         return _list.Where(x => x.StockType == type).Count();
 }