Exemplo n.º 1
0
        public override IEnumerator <IVideoItem> GetEnumerator()
        {
            yield return(FullScreenItem.Instance);

            foreach (var screen in ScreenItem.Enumerate(false))
            {
                yield return(screen);
            }
        }
Exemplo n.º 2
0
        public override IEnumerator <IVideoItem> GetEnumerator()
        {
            yield return(_fullScreenItem);

            yield return(_screenPickerItem);

            foreach (var screen in ScreenItem.Enumerate())
            {
                yield return(screen);
            }
        }
Exemplo n.º 3
0
        public override bool Deserialize(string Serialized)
        {
            var screen = ScreenItem.Enumerate()
                         .Select(M => M.Screen)
                         .FirstOrDefault(M => M.DeviceName == Serialized);

            if (screen == null)
            {
                return(false);
            }

            Set(screen);

            return(true);
        }
Exemplo n.º 4
0
        void RestoreVideoSource()
        {
            IScreen GetMatchingScreen()
            {
                return(ScreenItem.Enumerate()
                       .Select(M => M.Screen)
                       .FirstOrDefault(M => M.DeviceName == _settings.Video.Source));
            }

            switch (_settings.Video.SourceKind)
            {
            case VideoSourceKindEnum.Region:
                if (RectangleConverter.ConvertFromInvariantString(_settings.Video.Source) is Rectangle rect)
                {
                    _regionProvider.SelectedRegion = rect;

                    _videoViewModel.SelectedVideoSourceKind = _regionSourceProvider;
                }
                break;

            case VideoSourceKindEnum.NoVideo:
                var source = _noVideoSourceProvider.Sources.FirstOrDefault(M => M.Name == _settings.Video.Source);

                if (source != null)
                {
                    _noVideoSourceProvider.SelectedSource   = source;
                    _videoViewModel.SelectedVideoSourceKind = _noVideoSourceProvider;
                }
                break;

            case VideoSourceKindEnum.Window:
                var window = Window.EnumerateVisible().FirstOrDefault(M => M.Title == _settings.Video.Source);

                if (window != null)
                {
                    _windowSourceProvider.Set(window.Handle);
                    _videoViewModel.RestoreSourceKind(_windowSourceProvider);
                }
                break;

            case VideoSourceKindEnum.Screen:
            {
                var screen = GetMatchingScreen();

                if (screen != null)
                {
                    _screenSourceProvider.Set(screen);
                    _videoViewModel.RestoreSourceKind(_screenSourceProvider);
                }

                break;
            }

            case VideoSourceKindEnum.DeskDupl:
            {
                var screen = GetMatchingScreen();

                if (screen != null)
                {
                    _deskDuplSourceProvider.Set(screen);
                    _videoViewModel.RestoreSourceKind(_deskDuplSourceProvider);
                }

                break;
            }
            }
        }
Exemplo n.º 5
0
 public override IEnumerator <IVideoItem> GetEnumerator()
 {
     return(ScreenItem.Enumerate(true).GetEnumerator());
 }