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);
         });
     }
 }
Exemplo n.º 3
0
 public MediaSegment(IMediaSegments owner)
 {
     Owner        = owner;
     FieldLengths = EngineController.Database.MediaSegmentFieldLengths;
 }
Exemplo n.º 4
0
 public MediaSegment(IMediaSegments owner)
 {
     Owner = owner;
 }
Exemplo n.º 5
0
 public MediaSegment(IMediaSegments owner)
 {
     Owner        = owner;
     FieldLengths = DatabaseProvider.Database.MediaSegmentFieldLengths;
 }