Esempio n. 1
0
        private static async Task StartScreenCasting()
        {
            CursorIconWatcher = Services.GetRequiredService <ICursorIconWatcher>();

            await CasterSocket.Connect(Conductor.Host);

            await CasterSocket.SendDeviceInfo(Conductor.ServiceID, Environment.MachineName, Conductor.DeviceID);

            if (Win32Interop.GetCurrentDesktop(out var currentDesktopName))
            {
                Logger.Write($"Setting initial desktop to {currentDesktopName}.");
            }
            else
            {
                Logger.Write("Failed to get initial desktop name.");
            }

            if (!Win32Interop.SwitchToInputDesktop())
            {
                Logger.Write("Failed to set initial desktop.");
            }

            await SendReadyNotificationToViewers();

            Services.GetRequiredService <IdleTimer>().Start();
            CursorIconWatcher.OnChange += CursorIconWatcher_OnChange;
            Services.GetRequiredService <IClipboardService>().BeginWatching();
            Services.GetRequiredService <IKeyboardMouseInput>().Init();
        }
Esempio n. 2
0
        public MainWindowViewModel()
        {
            Current = this;

            if (Services is null)
            {
                return;
            }

            Application.Current.Exit += Application_Exit;

            _configService               = Services?.GetRequiredService <IConfigService>();
            _cursorIconWatcher           = Services?.GetRequiredService <ICursorIconWatcher>();
            _cursorIconWatcher.OnChange += CursorIconWatcher_OnChange;
            _conductor         = Services.GetRequiredService <Conductor>();
            _casterSocket      = Services.GetRequiredService <ICasterSocket>();
            _deviceInitService = Services.GetRequiredService <IDeviceInitService>();

            Services.GetRequiredService <IClipboardService>().BeginWatching();
            Services.GetRequiredService <IKeyboardMouseInput>().Init();
            _conductor.SessionIDChanged    += SessionIDChanged;
            _conductor.ViewerRemoved       += ViewerRemoved;
            _conductor.ViewerAdded         += ViewerAdded;
            _conductor.ScreenCastRequested += ScreenCastRequested;
        }
Esempio n. 3
0
 public ScreenCaster(Conductor conductor,
                     ICursorIconWatcher cursorIconWatcher,
                     ISessionIndicator sessionIndicator,
                     IShutdownService shutdownService)
 {
     _conductor         = conductor;
     _cursorIconWatcher = cursorIconWatcher;
     _sessionIndicator  = sessionIndicator;
     _shutdownService   = shutdownService;
 }
Esempio n. 4
0
 public ScreenCaster(Conductor conductor,
                     ICursorIconWatcher cursorIconWatcher)
 {
     Conductor         = conductor;
     CursorIconWatcher = cursorIconWatcher;
 }