public Emulator() { //prende la lista reale dal database _headSetsList = new List<HeadSet> { new Nokia3310(), new GalaxyS(), new IPhone6s() }; _currentHeadSet = null; }
//prima di adoperare devo sapere qualle il modello ha selezionato public void SetCurrentHeadset(string modelSelected) { foreach (HeadSet model in _headSetsList) { if (modelSelected == model.Model) { _currentHeadSet = model; break; } }// if (localHeadSet != null) { _currentHeadSet = localHeadSet; } else { throw new ArgumentException($"input model gived is invalid ! {modelSelected}"); } }