Exemple #1
0
        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;
            }
        }
Exemple #2
0
        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);
            }
        }
Exemple #3
0
        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);
            }
        }
Exemple #4
0
        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);
            }
        }
Exemple #5
0
        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);
            }
        }
Exemple #6
0
        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);
            }
        }
Exemple #7
0
 public void SetAndConnectSimCard(SimCorpMobile simCorpMobile, ISimCard simCard)
 {
     simCorpMobile.SimCard = simCard;
     simCorpMobile.ConnectToLocalMobileNetwork();
 }
Exemple #8
0
 public void SetAndRunStorage(SimCorpMobile simCorpMobile, IStorage storageComponent)
 {
     simCorpMobile.RemovableStorage = storageComponent;
     simCorpMobile.StoreToRemovableStorage(new Object());
 }
Exemple #9
0
 public void SetAndRunCharger(SimCorpMobile simCorpMobile, ICharger chargerComponent)
 {
     simCorpMobile.Charger = chargerComponent;
     simCorpMobile.Charge();
 }