public void ComponentSetting(SimCorpMobile simCorpMobile, AvailableForSettingPhoneComponents component) { switch (component) { case AvailableForSettingPhoneComponents.PlaybackComponent: ShowMenuOfPlaybacks(); GetAndProcessUserSelectionOfPlayback(simCorpMobile); break; case AvailableForSettingPhoneComponents.ChargerComponent: ShowMenuOfChargers(); GetAndProcessUserSelectionOfCharger(simCorpMobile); break; case AvailableForSettingPhoneComponents.StorageComponent: ShowMenuOfStorages(); GetAndProcessUserSelectionOfStorage(simCorpMobile); break; case AvailableForSettingPhoneComponents.SIMCard: ShowMenuOfSimCards(); GetAndProcessUserSelectionOfSimCard(simCorpMobile); break; } }
public void SelectAndSetComponents(SimCorpMobile simCorpMobile) { ShowMenuOfAvailableComponents(); string enteredComponentTypeIndex = Input.ReadLine(); try { AvailableForSettingPhoneComponents componentType = GetComponentType(enteredComponentTypeIndex); ComponentSetting(simCorpMobile, componentType); } catch (Exception e) { Output.Write(e.Message); } ShowExitDialog(); string enteredContinueIndication = Input.ReadLine(); try { bool continueIndication = GetContinueIndication(enteredContinueIndication); if (continueIndication) { SelectAndSetComponents(simCorpMobile); } } catch (Exception e) { Output.Write(e.Message); } }
public void GetAndProcessUserSelectionOfPlayback(SimCorpMobile simCorpMobile) { PlaybackHandler playbackHandler = new PlaybackHandler(Output); string enteredPlaybackTypeIndex = Input.ReadLine(); try { PlaybackComponentTypes playbackTypeIndex = playbackHandler.GetPlaybackType(enteredPlaybackTypeIndex); IPlayback playbackComponent = playbackHandler.GetPlayback(playbackTypeIndex); playbackHandler.SetAndRunPlayback(simCorpMobile, playbackComponent); } catch (Exception e) { Output.Write(e.Message); } }
public void GetAndProcessUserSelectionOfCharger(SimCorpMobile simCorpMobile) { ChargerHandler chargerHandler = new ChargerHandler(Output); string enteredChargerTypeIndex = Input.ReadLine(); try { ChargerComponentTypes chargerType = chargerHandler.GetChargerType(enteredChargerTypeIndex); ICharger chargerComponent = chargerHandler.GetCharger(chargerType); chargerHandler.SetAndRunCharger(simCorpMobile, chargerComponent); } catch (Exception e) { Output.Write(e.Message); } }
public void GetAndProcessUserSelectionOfStorage(SimCorpMobile simCorpMobile) { StorageHandler storageHandler = new StorageHandler(Output); string enteredStorageTypeIndex = Input.ReadLine(); try { StorageComponentTypes storageType = storageHandler.GetStorageType(enteredStorageTypeIndex); IStorage storageComponent = storageHandler.GetStorage(storageType); storageHandler.SetAndRunStorage(simCorpMobile, storageComponent); } catch (Exception e) { Output.Write(e.Message); } }
public void GetAndProcessUserSelectionOfSimCard(SimCorpMobile simCorpMobile) { SimCardHandler simCardHandler = new SimCardHandler(Output); string enteredSimCardTypeIndex = Input.ReadLine(); try { SimCardTypes simCardType = simCardHandler.GetSimCardType(enteredSimCardTypeIndex); ISimCard simCardComponent = simCardHandler.GetSimCard(simCardType); simCardHandler.SetAndConnectSimCard(simCorpMobile, simCardComponent); } catch (Exception e) { Output.Write(e.Message); } }
public void SetAndConnectSimCard(SimCorpMobile simCorpMobile, ISimCard simCard) { simCorpMobile.SimCard = simCard; simCorpMobile.ConnectToLocalMobileNetwork(); }
public void SetAndRunStorage(SimCorpMobile simCorpMobile, IStorage storageComponent) { simCorpMobile.RemovableStorage = storageComponent; simCorpMobile.StoreToRemovableStorage(new Object()); }
public void SetAndRunCharger(SimCorpMobile simCorpMobile, ICharger chargerComponent) { simCorpMobile.Charger = chargerComponent; simCorpMobile.Charge(); }