Пример #1
0
        public RackViewModel(Rack rack)
        {
            this._rack = rack;
            ChildViewModelList = new List<BaseViewModel>();
            List<Box> myBoxList = DeviceDataService.GetMyBoxes(_rack.Name);

            foreach (Box box in myBoxList)
            {
                if (box.Name != "NO_BOX")
                    ChildViewModelList.Add(new BoxViewModel(box));
                else
                {
                    List<Card> myCardList = DeviceDataService.GetMyCards(box.Name);
                    foreach (Card card in myCardList)
                    {
                        ChildViewModelList.Add(new CardViewModel(card));
                    }
                }
            }
        }
Пример #2
0
 public Box(string name, Rack parent)
 {
     this.Name = name;
     this._parent = parent;
     _boxList.Add(this);
 }