public Mobile GetMobile(MobileModels model, IOutput output) { switch (model) { case MobileModels.SC1102: return(new SimCorpMobileModel(output, MobileModels.SC1102, new GreyScreen(), new DynamicMicrophone(), new Battery(2000, BatteryType.LIIO), new Speaker(), 2, new SMSStorage(20))); case MobileModels.SC1103: return(new SimCorpMobileModel(output, MobileModels.SC1103, new ColorScreen(DisplayModeEnum.HIGHSPEED), new CondenserMicrophone(), new Battery(2600, BatteryType.LIPO), new Speaker(), 2, new SMSStorage(500))); case MobileModels.SC1104: return(new SimCorpMobileModel(output, MobileModels.SC1104, new ColorScreen(DisplayModeEnum.LOWSPEED), new CondenserMicrophone(), new Battery(3600, BatteryType.LIPO), new Speaker(), 2, new SMSStorage(1000))); default: throw new NotSupportedException($"Model {model} is not supported yet, please update code."); } }
public ActionResult Mobiles() { MobileModels MobileModel = new MobileModels(); var mobiles = MobileModel.GetMobile(); return(View(mobiles)); }
public ActionResult MobileRegister() { MobileModels MobileModel = new MobileModels(); var brand = MobileModel.GetBrand(); ViewBag.brand = brand; MobileViewModel MobileVM = new MobileViewModel(); return(View(MobileVM)); }
private Mobile getConfiguredMobilePhone(MobileModels model) { MobileFactory factory = MobileFactory.Instance(); Mobile mobile = factory.GetMobile(model, _output); var airPods = new AirPods(); mobile.ConnectBluetoothSoundDevice(airPods); var bluetoothSpeaker = new BluetoothSpeaker(); mobile.ConnectBluetoothSoundDevice(bluetoothSpeaker); return(mobile); }
public ActionResult MobileRegister(MobileViewModel MobileView) { MobileModels MobileModel = new MobileModels(); var AMobile = MobileModel.ConvertMobileViewToMobile(MobileView); MobileModel.InsertMobile(AMobile); var brand = MobileModel.GetBrand(); ViewBag.brand = brand; DateTimeConvert DateModel = new DateTimeConvert(); var dateText = DateModel.ConvertDateTimeToString(MobileView.ProductionDate); MobileView.DateText = dateText; return(View(MobileView)); }
internal SimCorpMobileModel(IOutput output, MobileModels mobileModel, Screen screen, Microphone microphone, Battery battery, Speaker dynamic, int availableSimCardSlots, SMSStorage smsStorage) { Output = output; Screen = screen; MobileModel = mobileModel; Microphone = microphone; Battery = battery; Speaker = dynamic; AvailableSimCardSlots = availableSimCardSlots; SMSStorage = smsStorage; var discharger = new BatteryDischarger(-1); discharger.Discharge += Battery.DecreaseChargeLevel; discharger.Start(); var thread = new Thread(CheckBattery); thread.Start(); thread.IsBackground = true; }
public SMSViewerForm(MobileModels model) { _model = model; InitializeComponent(); }
public MobilePhoneForm(MobileModels model) { _model = model; InitializeComponent(); }