private void buttonApplyPlaybackComp_Click(object sender, EventArgs e) { richTextBoxPlaybackCompInfo.Clear(); string selectedItem = comboBoxSelectPlaybackComp.Text; var playableDeviceType = PlaybackDeviceType.None; if (selectedItem == "PhoneHeadset") { playableDeviceType = PlaybackDeviceType.PhoneHeadset; } else if (selectedItem == "PhoneSpeaker") { playableDeviceType = PlaybackDeviceType.PhoneSpeaker; } IOutput winformOutput = new WinFormOutput(richTextBoxPlaybackCompInfo); if (playableDeviceType != PlaybackDeviceType.None) { var mobilePhone = new SimCorpMobile(); var playbackDevice = PlaybackDeviceFactory.CreatePlaybackDevice(playableDeviceType, winformOutput); mobilePhone.Play(playbackDevice, winformOutput); } else { winformOutput.WriteLine("Select PlaybackDeviceType!"); } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); IOutput myOutputType = new WinFormOutput(); Application.Run(new Form1(myOutputType)); }
private static void Main() { Mobile mobile = new SimCorpMobile(); IOutput output = new WinFormOutput(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new SelectPlaybackComponent(mobile, output)); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); IOutput myOutputType = new WinFormOutput(); Mobile mymobile = InstantiateSimCorpMobile(myOutputType); Application.Run(new Form1(myOutputType, mymobile)); }
private static void Main() { Mobile mobile = new SimCorpMobile(); IOutput output = new WinFormOutput(); string message = "Hello! This is a KSBL's dummy incoming message."; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new SmsViewer(mobile, output, message)); }
private void ShowMessageInfo(string textMessage) { if (richTextBoxMessageInfo.InvokeRequired == true) { var del = new ShowMessageInfoDelegate(ShowMessageInfo); this.Invoke(del, new object[] { textMessage }); } else { var winformOutput = new WinFormOutput(richTextBoxMessageInfo); winformOutput.WriteLine(textMessage); } }
private static void Main() { Mobile mobile = new SimCorpMobile(); IOutput output = new WinFormOutput(); MessageGeneratorCreator messageGeneratorCreator1 = new MessageGeneratorCreatorTask(); MessageGeneratorCreator messageGeneratorCreator2 = new MessageGeneratorCreatorThread(); var messageGenerator = messageGeneratorCreator1.Create(mobile); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new SmsViewer(mobile, output, messageGenerator)); }
private static void Main() { Mobile mobile = new SimCorpMobile(); IOutput output = new WinFormOutput(); var message1 = new Message("KSBL", "Hello! This is a KSBL's (test analyst's) dummy incoming message.", DateTime.Now); var message2 = new Message("VZL", "Hello! This is a VZL's (tech-lead's) dummy incoming message.", DateTime.Now); var message3 = new Message("OKTK", "Hello! This is a OKTK's (scrum-master's) dummy incoming message.", DateTime.Now); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new SmsViewer(mobile, output, message1, message2, message3)); }
private void backgroundWorkerMessageReciecer_DoWork(object sender, DoWorkEventArgs e) { var rnd = new Random(); var message = providers[1]; var format = MessageFormat.None; var fomatedMessage = ""; smsStorage.SMSProviderService.SMSRecieved += (m) => ShowMessageInfo(m); do { message = providers[rnd.Next(providers.Count)]; format = CreateFormat(); fomatedMessage = SetMessageFormat($"{message} SMS recieved!", format); smsStorage.ReceiveMessage(fomatedMessage); Thread.Sleep(1000); }while (!backgroundWorkerMessageReciecer.CancellationPending == true); e.Cancel = true; var winformOutput = new WinFormOutput(richTextBoxMessageInfo); }