/* * This section contains functionality for local monitors (sreens) control: * - Adding / removing monitor if such has been plugged in / plugged out * - Selecting / deselecting specific monitor share on UI and on API level * - Starting share (used in command binding) */ public void AddLocalMonitor(LocalMonitorModel monitor) { if (LocalMonistors.FirstOrDefault(x => x.Id.Equals(monitor.Id)) == null) { System.Windows.Application.Current.Dispatcher.Invoke(() => LocalMonistors.Add(monitor)); Log.Info(string.Format("Added local monitor: name={0} id={1}", monitor.DisplayName, monitor.Id)); } }
private void StartLocalMonitorShare() { var monitorToShare = LocalMonistors.FirstOrDefault(x => x.IsSelected); if (monitorToShare != null) { SharingInProgress = _connector.SelectLocalMonitor(monitorToShare.Object); Log.Info(string.Format("Set selected local window share: name={0} id={1}", monitorToShare.DisplayName, monitorToShare.Id)); } }
public void RemoveLocalMonitor(LocalMonitorModel monitor) { var monitorToRemove = LocalMonistors.FirstOrDefault(x => x.Id.Equals(monitor.Id)); if (monitorToRemove != null) { System.Windows.Application.Current.Dispatcher.Invoke(() => LocalMonistors.Remove(monitorToRemove)); Log.Info(string.Format("Removed local monitor: name={0} id={1}", monitorToRemove.DisplayName, monitorToRemove.Id)); } }
public void SetSelectedLocalMonitor(LocalMonitorModel monitor) { LocalMonistors.Select(x => { x.IsSelected = false; return(x); }) .ToList(); var monitorToSelect = LocalMonistors.FirstOrDefault(x => x.Id.Equals(monitor.Id)); if (monitorToSelect != null) { monitorToSelect.IsSelected = true; Log.Info(string.Format("Local window selected: name={0} id={1}", monitorToSelect.DisplayName, monitorToSelect.Id)); } }