private void applyButton_Click(object sender, EventArgs e) { OLEDScreen OLEDScreen = new OLEDScreen(768, 1024); LiPoBattery liPoBattery = new LiPoBattery(4100, 3.7, 83); MultiCoreCPU multiCoreCPU = new MultiCoreCPU("SnapDragon", 2.1, 2); MessageStorage messageStorage = new MessageStorage("+380971994730"); SimCorpMobile scmobile = new SimCorpMobile(OLEDScreen, liPoBattery, multiCoreCPU, messageStorage); WinFormsOutput winFormOutput = new WinFormsOutput(this); listBox.Items.Clear(); if (radioButtoniPhone.Checked == true) { scmobile.PlaybackComponent = new iPhoneHeadset(winFormOutput); } else if (radioButtonSamsung.Checked == true) { scmobile.PlaybackComponent = new SamsungHeadset(winFormOutput); } else if (radioButtonNoNameHeadset.Checked == true) { scmobile.PlaybackComponent = new NoNameHeadset(winFormOutput); } else if (radioButtonPhoneSpeaker.Checked == true) { scmobile.PlaybackComponent = new PhoneSpeaker(winFormOutput); } else { listBox.Items.Add("Nothing is selected"); } scmobile.Play("Unknown Artist - His Song"); }
public SimCorpMobile(IOutput output) { Output = output; vModelName = "SimCorp Mobile"; vBattery = new LiIonBattery(3000, 1500); vSpeaker = new StereoSpeakerSystem(new RealSpeaker(2), new RealSpeaker(2), 40, this.Output); vSpeakerName = nameof(StereoSpeakerSystem); vKeyBoard = new TouchScreenKeyboard(); vMicrophone = new MobileMicrophone(); vSimCard = new DualSimCardSlot(SimCardTypes.MicroSimCard, SimCardTypes.NanoSimCard); vScreen = new OLEDScreen(1280, 720, 280); vMainCamera = new VideoCamera("Main", 13, true, true); vFrontalCamera = new VideoCamera("Frontal", 5, true, true); vCallStor = new CallStorage(); Contact contact1 = new Contact("Taras", new List <string> { "0633333333", "0966666666" }); Contact contact2 = new Contact("Jeeves", "0674612131"); Contact contact3 = new Contact("Wooster", "0503322189"); vContactStor = new ContactStorage(new List <Contact> { contact1, contact2, contact3 }); CallGen = new CallGenerator(vContactStor); CallGen.CallReceived += OnCallReceived; }
public ScreenBase defineScreen() { ScreenBase result = new ColorfulScreen(); Console.WriteLine("Choose screen type index:"); Console.WriteLine($"0 - {nameof(MonochromeScreen)}"); Console.WriteLine($"1 - {nameof(ColorfulScreen)}"); int screenType = Convert.ToInt32(Console.ReadLine()); if (screenType == 0) { result = new MonochromeScreen(); } if (screenType == 1) { Console.WriteLine("Choose ColorfulScreen type index:"); Console.WriteLine($"0 - {nameof(OLEDScreen)}"); Console.WriteLine($"1 - {nameof(RetinaScreen)}"); int colorfulScreenType = Convert.ToInt32(Console.ReadLine()); if (colorfulScreenType == 0) { result = new OLEDScreen(); } else if (colorfulScreenType == 1) { result = new RetinaScreen(); } } return(result); }
private SimCorpMobile InitSimCorpMobile() { OLEDScreen OLEDScreen = new OLEDScreen(768, 1024); LiPoBattery liPoBattery = new LiPoBattery(4100, 3.7, 83); MultiCoreCPU multiCoreCPU = new MultiCoreCPU("SnapDragon", 2.1, 2); MessageStorage messageStorage = InitMessageStorage("+380971994730"); SimCorpMobile scmobile = new SimCorpMobile(OLEDScreen, liPoBattery, multiCoreCPU, messageStorage); scmobile.MessageStorage = messageStorage; return(scmobile); }
private SimCorpMobileThreadTask InitSimCorpMobileThreadTask() { OLEDScreen OLEDScreen = new OLEDScreen(768, 1024); LiPoBattery liPoBattery = new LiPoBattery(4100, 3.7, 20); MultiCoreCPU multiCoreCPU = new MultiCoreCPU("SnapDragon", 2.1, 2); MessageStorage messageStorage = InitMessageStorage(MyPhoneNo); SimCorpMobileThreadTask scmobile = new SimCorpMobileThreadTask(OLEDScreen, liPoBattery, multiCoreCPU, messageStorage); scmobile.MessageStorage = messageStorage; return(scmobile); }
public SimCorpMobile() { vModelName = "SimCorp Mobile"; vBattery = new LiIonBattery(3000); vSpeaker = new StereoSpeakerSystem(new RealSpeaker(2), new RealSpeaker(2), 40); vKeyBoard = new TouchScreenKeyboard(); vMicrophone = new MobileMicrophone(); vSimCard = new DualSimCardSlot(SimCardTypes.MicroSimCard, SimCardTypes.NanoSimCard); vScreen = new OLEDScreen(1280, 720, 280); vMainCamera = new VideoCamera("Main", 13, true, true); vFrontalCamera = new VideoCamera("Frontal", 5, true, true); }
static void Main(string[] args) { OLEDScreen screen = new OLEDScreen(5, 1920, 1080); LithiumLonBattery battery = new LithiumLonBattery(4000); PhoneSpeaker speaker = new PhoneSpeaker(1000, new ConsoleOutput()); SimCorpMobile simMobile = new SimCorpMobile(screen, battery, speaker); SamsungHeadset samsungHeadsetComp = new SamsungHeadset(300, new ConsoleOutput()); IPhoneHeadset iPhoneHeadsetComp = new IPhoneHeadset(350, new ConsoleOutput()); IAudioController samsungHeadset = (IAudioController)samsungHeadsetComp; IAudioController iPhoneHeadset = (IAudioController)iPhoneHeadsetComp; List <string> playComponentsMenuItems = new List <string>(); playComponentsMenuItems.Add("Phone speaker"); playComponentsMenuItems.Add("Samsung Headset"); playComponentsMenuItems.Add("iPhone Headset"); int userPlaybackChoice = 0; while (true) { while (userPlaybackChoice == 0) { Console.WriteLine(simMobile.ToString()); Console.WriteLine("Please select component (specify index)\n"); foreach (string item in playComponentsMenuItems) { Console.Write(playComponentsMenuItems.IndexOf(item) + 1 + ". "); Console.WriteLine(item); } Console.Write("\nYour choice: "); userPlaybackChoice = CheckUserInput(Console.ReadLine(), playComponentsMenuItems); } switch (userPlaybackChoice) { case 1: simMobile.Play(); break; case 2: simMobile.Play(samsungHeadset); break; case 3: simMobile.Play(iPhoneHeadset); break; } userPlaybackChoice = 0; Console.ReadKey(); Console.Clear(); } }
public SimCorpMobile(IOutput output) { Output = output; vModelName = "SimCorp Mobile"; vBattery = new LiIonBattery(3000, 1500); vSpeaker = new StereoSpeakerSystem(new RealSpeaker(2), new RealSpeaker(2), 40, this.Output); vSpeakerName = nameof(StereoSpeakerSystem); vKeyBoard = new TouchScreenKeyboard(); vMicrophone = new MobileMicrophone(); vSimCard = new DualSimCardSlot(SimCardTypes.MicroSimCard, SimCardTypes.NanoSimCard); vScreen = new OLEDScreen(1280, 720, 280); vMainCamera = new VideoCamera("Main", 13, true, true); vFrontalCamera = new VideoCamera("Frontal", 5, true, true); SMSProvider = new SMSProvider(); vMsgStor = new MsgStorage(); SMSProvider.SMSReceived += OnSMSReceived; }
public SimCorpMobile(IOutput output) : base(output) { OledScreen = new OLEDScreen(output, new CoordsFlat(720, 1280), new SizeFlat(50f, 100f)); }
public SimCorpMobile(IOutput output, BackgroundWorkerFactoryMethod backgroundWorkerFactory = null) : base(output, backgroundWorkerFactory) { OledScreen = new OLEDScreen(output, new CoordsFlat(720, 1280), new SizeFlat(50f, 100f)); }