Пример #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!");
            }
        }
Пример #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            IOutput myOutputType = new WinFormOutput();

            Application.Run(new Form1(myOutputType));
        }
Пример #3
0
        private static void Main()
        {
            Mobile  mobile = new SimCorpMobile();
            IOutput output = new WinFormOutput();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new SelectPlaybackComponent(mobile, output));
        }
Пример #4
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            IOutput myOutputType = new WinFormOutput();
            Mobile  mymobile     = InstantiateSimCorpMobile(myOutputType);

            Application.Run(new Form1(myOutputType, mymobile));
        }
Пример #5
0
        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));
        }
Пример #6
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);
     }
 }
Пример #7
0
        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));
        }
Пример #8
0
        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));
        }
Пример #9
0
        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);
        }