Ejemplo 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();
        }
Ejemplo n.º 2
0
 public async Task Connect()
 {
     await CasterSocket.Connect(Host);
 }