Пример #1
0
 public VideoModule(
     IScoreKeeperService scoreKeeperService,
     IStopWatchService stopWatchService)
 {
     this.scoreKeeperService = scoreKeeperService;
     this.stopWatchService   = stopWatchService;
     this.pipeCommandService = null;
 }
Пример #2
0
 public VideoModule(
     IScoreKeeperService scoreKeeperService,
     IStopWatchService stopWatchService)
 {
     this.scoreKeeperService = scoreKeeperService;
     this.stopWatchService = stopWatchService;
     this.pipeCommandService = null;
 }
Пример #3
0
        private void NamedPipesBegin()
        {
            UseThisThreadForEvents();

            PipeSender.begin("FromArduino");
            PipeListener.begin("ToArduino", new NewMessageDelegate(PipesMessageHandler));

            connectionTestTimer = new DispatcherTimer();

            connectionTestTimer.Tick    += ConnectionTestTimer_Tick;
            connectionTestTimer.Interval = new TimeSpan(0, 0, 2);
            connectionTestTimer.Start();
        }
Пример #4
0
        /// <summary>
        /// Event: Triggered when the Choose Image button is clicked
        /// </summary>
        private void itsButtonChoose_Click(object sender, EventArgs e)
        {
            OpenFileDialog anOpenDialog = new OpenFileDialog()
            {
                Filter = "PNG (*.png)|*.png",
                Title  = "Choose An Image To Send",
            };

            if (anOpenDialog.ShowDialog() == DialogResult.OK && File.Exists(anOpenDialog.FileName))
            {
                Image  anImageToSend = Image.FromFile(anOpenDialog.FileName);
                string aFileSize     = Utilities.GetFileSizeBytesReadable(anOpenDialog.FileName);
                PipeMessageImageShare aPipeMessageImageShare = new PipeMessageImageShare(anImageToSend, Path.GetFileName(anOpenDialog.FileName), aFileSize);
                //OnSend(this, new PipeMessageEventArgs(aPipeMessageImageShare));
                PipeSender.SendPipeMessage(aPipeMessageImageShare);
                aPipeMessageImageShare.ImageSenderName = "Me";
                HandleMessage(aPipeMessageImageShare);
            }
        }
Пример #5
0
        /// <summary>
        /// Notifies the video capture process.
        /// </summary>
        /// <param name="command">The command.</param>
        /// <param name="p">The p.</param>
        private void NotifyVideoCapture(string command, params string[] p)
        {
            Process videoCaptureProcess = this.GetVideoCaptureProcess();

            if (videoCaptureProcess != null && videoCaptureProcess.Responding)
            {
                try
                {
                    if (this.pipeCommandService == null)
                    {
                        this.pipeCommandService = new PipeSender <ICommandService>();
                    }
                    this.pipeCommandService.Instance.Execute(command, p);
                }
                catch (Exception ex)
                {
                    System.Diagnostics.Debug.WriteLine("VideoModule: " + ex.GetBaseException());
                    this.pipeCommandService = null;
                }
            }
        }
Пример #6
0
 /// <summary>
 /// Notifies the video capture process.
 /// </summary>
 /// <param name="command">The command.</param>
 /// <param name="p">The p.</param>
 private void NotifyVideoCapture(string command, params string[] p)
 {
     Process videoCaptureProcess = this.GetVideoCaptureProcess();
     if (videoCaptureProcess != null && videoCaptureProcess.Responding)
     {
         try
         {
             if (this.pipeCommandService == null)
             {
                 this.pipeCommandService = new PipeSender<ICommandService>();
             }
             this.pipeCommandService.Instance.Execute(command, p);
         }
         catch (Exception ex) 
         {
             System.Diagnostics.Debug.WriteLine("VideoModule: " + ex.GetBaseException());
             this.pipeCommandService = null;
         }
     }
 }
Пример #7
0
        /// <summary>
        /// Event: Triggered when the - button is clicked
        /// </summary>
        private void itsButtonMinus_Click(object sender, EventArgs e)
        {
            PipeMessageNumberGameAdd aMessageSubtract1 = new PipeMessageNumberGameAdd(-1);

            PipeSender.SendPipeMessage(aMessageSubtract1);
        }
Пример #8
0
        /// <summary>
        /// Event: Triggered when the + button is clicked
        /// </summary>
        private void itsButtonPlus_Click(object sender, EventArgs e)
        {
            PipeMessageNumberGameAdd aMessageAdd1 = new PipeMessageNumberGameAdd(1);

            PipeSender.SendPipeMessage(aMessageAdd1);
        }
Пример #9
0
 private void dispose()
 {
     PipeSender.dispose();
     PipeListener.dispose(new NewMessageDelegate(PipesMessageHandler));
 }
Пример #10
0
 private void Send(string inMessage)
 {
     PipeSender.Send(inMessage, 1000);
 }