Example #1
0
        private void ActiveWindowButton_Click(object sender, RoutedEventArgs e)
        {
            this.SharingSource = new SharingSources.ActiveWindowSharingSource();
            this.DialogResult  = true;

            this.Close();
        }
Example #2
0
        private void MJPEGStreamButton_Click(object sender, RoutedEventArgs e)
        {
            this.SharingSource = new SharingSources.MJPEGStreamSharingSource();
            this.DialogResult  = true;

            this.Close();
        }
Example #3
0
        private void EntireDesktopButton_Click(object sender, RoutedEventArgs e)
        {
            this.SharingSource = new SharingSources.EntireDesktopSharingSource();
            this.DialogResult  = true;

            this.Close();
        }
Example #4
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if ((string)button1.Content == "Start Sharing")
            {
                SharingSource = null;

                SharingSourceDialog ssd = new SharingSourceDialog();
                if (ssd.ShowDialog() == true)
                {
                    StreamOutputDialog sod = new StreamOutputDialog();

                    if (sod.ShowDialog() == true)
                    {
                        SharingSource = ssd.SharingSource;

                        SharingSource.NewFrame  += SharingSource_NewFrame;
                        SharingSource.FPSUpdate += SharingSource_FPSUpdate;


                        button1.Content = "Stop Sharing";

                        //output = new FrameServer(IPAddress.Any, 8076);
                        output = sod.StreamOutput;

                        if (output.Port != null)
                        {
                            NATDialog natd = new NATDialog((int)output.Port);
                            if (natd.ShowDialog() == true)
                            {
                                lastIpAddress = natd.IPAddress;
                            }
                        }
                        else
                        {
                            lastIpAddress = "::";
                        }



                        output.ControlPacketReceived += server_ControlPacketReceived;
                        output.ClientConnected       += server_ClientConnected;
                        output.ClientDisconnected    += server_ClientDisonnected;
                        output.Start();

                        SharingSource.Start();

                        if (lastIpAddress != "::")
                        {
                            serverStatusLabel.Content = "Server listening at: " + lastIpAddress + ":" + output.Port;
                        }
                        else
                        {
                            serverStatusLabel.Content = "Server listening";
                        }

                        serverStatusLabel.Background = new SolidColorBrush(System.Windows.Media.Color.FromRgb(116, 224, 131));
                    }
                }
            }
            else
            {
                button1.Content = "Start Sharing";

                StopSharing();
            }
        }