Exemplo n.º 1
0
 private void ScreenCastRequested(object sender, ScreenCastRequest screenCastRequest)
 {
     App.Current.Dispatcher.Invoke(() =>
     {
         var result = MessageBox.Show($"You've received a connection request from {screenCastRequest.RequesterName}.  Accept?", "Connection Request", MessageBoxButton.YesNo, MessageBoxImage.Question);
         if (result == MessageBoxResult.Yes)
         {
             Task.Run(async() =>
             {
                 ICapturer capturer;
                 try
                 {
                     if (Conductor.Viewers.Count == 0)
                     {
                         capturer = new DXCapture();
                     }
                     else
                     {
                         capturer = new BitBltCapture();
                     }
                 }
                 catch (Exception ex)
                 {
                     Logger.Write(ex);
                     capturer = new BitBltCapture();
                 }
                 await Conductor.CasterSocket.SendCursorChange(CursorIconWatcher.GetCurrentCursor(), new List <string>()
                 {
                     screenCastRequest.ViewerID
                 });
                 ScreenCaster.BeginScreenCasting(screenCastRequest.ViewerID, screenCastRequest.RequesterName, capturer, Conductor);
             });
         }
     });
 }
Exemplo n.º 2
0
        private static async void ScreenCastInitiated(object sender, ScreenCastRequest screenCastRequest)
        {
            ICapturer capturer;

            try
            {
                if (Conductor.Viewers.Count == 0)
                {
                    capturer = new DXCapture();
                }
                else
                {
                    capturer = new BitBltCapture();
                }
            }
            catch (Exception ex)
            {
                Logger.Write(ex);
                capturer = new BitBltCapture();
            }
            await Conductor.CasterSocket.SendCursorChange(CursorIconWatcher.GetCurrentCursor(), new List <string>() { screenCastRequest.ViewerID });

            ScreenCaster.BeginScreenCasting(screenCastRequest.ViewerID, screenCastRequest.RequesterName, capturer, Conductor);
            BeginAudioCapture();
        }
Exemplo n.º 3
0
        private static ICapturer GetCapturer()
        {
            ICapturer capturer;

            try
            {
                if (Conductor.Current.Viewers.Count == 0)
                {
                    capturer = new DXCapture();
                }
                else
                {
                    capturer = new BitBltCapture();
                }
            }
            catch (Exception ex)
            {
                Logger.Write(ex);
                capturer = new BitBltCapture();
            }

            return(capturer);
        }