Ejemplo n.º 1
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);
            }
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
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);
        }