示例#1
0
 public SavedPlayerState(MediaLibrary.DataModels.ContentType contentType, ItemBase file, SmartView2.Controls.MediaElementState mediaElementState, double position, IEnumerable <ItemBase> files, bool?isRepeat, bool isRandom)
 {
     this.ContentType       = contentType;
     this.File              = file;
     this.MediaElementState = mediaElementState;
     this.Position          = position;
     this.FileList          = files;
     this.IsRepeat          = isRepeat;
     this.IsRandom          = isRandom;
 }
示例#2
0
 public VideoImageViewModel(IDataLibrary library, IMultiScreen multiScreen, MultimediaFolder rootfolder, MediaLibrary.DataModels.ContentType type)
 {
     if (library == null)
     {
         throw new Exception("multiScreen cant work with null library");
     }
     if (multiScreen == null)
     {
         throw new ArgumentNullException("multiScreen is null");
     }
     this.dataLibrary        = library;
     this.multiScreen        = multiScreen;
     this.rootFolder         = rootfolder;
     this.ContentType        = type;
     this.IsBackVisible      = false;
     this.IsCopyPasteVisible = Visibility.Collapsed;
     this.CurrentFolder      = this.rootFolder;
     this.ViewType           = VideoPhotoViewType.Date;
     this.ReloadItemsCollection();
     this.TemporaryDataLoaded = this.dataLibrary.IsDataLoaded;
     if (type != MediaLibrary.DataModels.ContentType.Image)
     {
         this.IsMenuPlayVisible   = Visibility.Visible;
         this.ImageIconVisibility = Visibility.Collapsed;
         this.VideoIconVisibility = Visibility.Visible;
     }
     else
     {
         this.IsMenuPlayVisible   = Visibility.Collapsed;
         this.ImageIconVisibility = Visibility.Visible;
         this.VideoIconVisibility = Visibility.Collapsed;
     }
     this.addFilesCommand        = new Command(new Action <object>(this.OnAddFiles));
     this.addFolderCommand       = new Command(new Action <object>(this.OnAddFolder));
     this.RemoveFolderCommand    = new Command(new Action <object>(this.OnRemoveFolder));
     this.deleteItemCommand      = new Command(new Action <object>(this.OnDeleteItem));
     this.itemDoubleClickCommand = new Command(new Action <object>(this.OnItemDoubleClick));
     this.videoImageBackCommand  = new Command(new Action <object>(this.OnVideoImageBack));
     this.sendToQueueCommand     = new Command(new Action <object>(this.OnSendToQueue));
     this.playLocalCommand       = new Command(new Action <object>(this.OnPlayLocal));
     this.mainViewChangedCommand = new Command(new Action <object>(this.OnMainViewChanged));
     this.playOnTvCommand        = new Command(new Action <object>(this.OnPlayOnTv));
     this.dragItem            = new Command(new Action <object>(this.OnDragItem));
     this.contentDropCommand  = new Command(new Action <object>(this.OnContentDrop));
     this.cancelAddingCommand = new Command(new Action <object>(this.OnCancelAdding));
 }
 public MediaPlayerViewModel(BaseSavedVisualState savedState, IMultiScreen multiScreen, IDataLibrary dataLibrary, IEnumerable <ItemBase> files, Content selectedFile, MediaLibrary.DataModels.ContentType contentType) : this(savedState, multiScreen, dataLibrary)
 {
     if (files == null)
     {
         throw new ArgumentNullException("files");
     }
     this.ContentType = contentType;
     this.Position    = 0;
     if (contentType != MediaLibrary.DataModels.ContentType.Track)
     {
         this.files = new FileList(files);
     }
     else
     {
         this.files = new TrackList(files);
     }
     if (selectedFile != null)
     {
         this.SelectedFile = selectedFile;
         return;
     }
     this.SelectedFile = files.FirstOrDefault <ItemBase>();
 }
示例#4
0
 public VideoImageViewModel(SavedVideoPhotoVisualstate visualstate, IDataLibrary library, IMultiScreen multiScreen, MultimediaFolder rootfolder, MediaLibrary.DataModels.ContentType type) : this(library, multiScreen, rootfolder, type)
 {
     if (visualstate == null)
     {
         return;
     }
     this.CurrentFolder = visualstate.CurrentItem;
     this.ViewType      = visualstate.ViewType;
     if (this.ViewType == VideoPhotoViewType.NoContent && rootfolder.GetAllFilesList(null).Count > 0)
     {
         this.ViewType        = VideoPhotoViewType.Date;
         visualstate.ViewType = VideoPhotoViewType.Date;
         this.ReloadItemsCollection();
     }
     this.ComboBoxCurrentState = (int)this.ViewType;
     if (this.currentFolder == this.rootFolder || this.ViewType != VideoPhotoViewType.Folder)
     {
         this.ReloadItemsCollection();
     }
     else
     {
         this.OnItemDoubleClick(this.currentFolder);
     }
     if (visualstate.PlayerState != null)
     {
         this.savedVisualState = visualstate;
     }
 }