Пример #1
0
        private void ReceiveScreen_OnClick(object Sender, RoutedEventArgs E)
        {
            ScreenCast?.Stop();
            ScreenCast = new ScreenCast(IPAddress.Parse(Ip.Text));
            ScreenCastWindow scw = new ScreenCastWindow();

            ScreenCast.OnFrameChange += (s) =>
            {
                scw.Dispatcher.Invoke(() =>
                {
                    scw.ScreenCast_OnFrameChange(s);
                });
            };
            scw.Show();
            ScreenCast.ReceiveAsync();
        }
Пример #2
0
        private void ShareScreen_OnClick(object Sender, RoutedEventArgs E)
        {
            IsScreenCasting = !IsScreenCasting;
            ScreenCast?.Stop();

            if (IsScreenCasting)
            {
                ScreenCast = new ScreenCast(IPAddress.Parse(Ip.Text));
                ScreenCast.SendAsync();
                ShareScreen.Content     = "Stop";
                ReceiveScreen.IsEnabled = false;
            }
            else
            {
                ShareScreen.Content     = "Share Screen";
                ReceiveScreen.IsEnabled = true;
            }
        }