public MediaViewViewmodel(IMedia media, IMediaManager mediaManager) { Media = media; media.PropertyChanged += OnMediaPropertyChanged; if (media is IPersistentMedia pm) { _mediaSegments = new Lazy <ObservableCollection <MediaSegmentViewmodel> >(() => { _segments = pm.GetMediaSegments(); var result = new ObservableCollection <MediaSegmentViewmodel>(_segments.Segments.Select(ms => new MediaSegmentViewmodel(pm, ms))); _segments.SegmentAdded += MediaSegments_SegmentAdded; _segments.SegmentRemoved += _mediaSegments_SegmentRemoved; return(result); }); } if (media is IServerMedia serverMedia) { _isArchivedLazy = new Lazy <bool>(() => mediaManager.ArchiveDirectory?.ContainsMedia(serverMedia.MediaGuid) ?? false); } if (media is IIngestMedia ingestMedia) { _ingestStatusLazy = new Lazy <TIngestStatus>(() => mediaManager.MediaDirectoryPRI != null ? ingestMedia.GetIngestStatus(mediaManager.MediaDirectoryPRI) : TIngestStatus.Unknown ); } }
public MediaViewViewmodel(IMedia media) { Media = media; media.PropertyChanged += OnMediaPropertyChanged; if (media is IPersistentMedia pm) { _mediaSegments = new Lazy <ObservableCollection <MediaSegmentViewmodel> >(() => { _segments = pm.GetMediaSegments(); var result = new ObservableCollection <MediaSegmentViewmodel>(_segments.Segments.Select(ms => new MediaSegmentViewmodel(pm, ms))); _segments.SegmentAdded += MediaSegments_SegmentAdded; _segments.SegmentRemoved += _mediaSegments_SegmentRemoved; return(result); }); } }
public MediaSegment(IMediaSegments owner) { Owner = owner; FieldLengths = EngineController.Database.MediaSegmentFieldLengths; }
public MediaSegment(IMediaSegments owner) { Owner = owner; }
public MediaSegment(IMediaSegments owner) { Owner = owner; FieldLengths = DatabaseProvider.Database.MediaSegmentFieldLengths; }