Beispiel #1
0
        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!");
            }
        }
Beispiel #2
0
 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);
     }
 }