コード例 #1
0
        public void OnMainViewChanged(object obj)
        {
            switch ((int)obj)
            {
            case 0:
            {
                this.ViewType = VideoPhotoViewType.Date;
                this.ReloadItemsCollection();
                return;
            }

            case 1:
            {
                this.ViewType = VideoPhotoViewType.Title;
                this.ReloadItemsCollection();
                return;
            }

            case 2:
            {
                this.ViewType = VideoPhotoViewType.Folder;
                this.ReloadItemsCollection();
                return;
            }

            default:
            {
                return;
            }
            }
        }
コード例 #2
0
        private void OnItemDoubleClick(object obj)
        {
            ItemBase itemBase = (ItemBase)obj;

            switch (itemBase.Type)
            {
            case ItemType.Content:
            {
                this.OnPlayLocal(obj);
                return;
            }

            case ItemType.Folder:
            {
                this.CurrentFolder = (MultimediaFolder)itemBase;
                this.IsBackVisible = true;
                this.ViewType      = VideoPhotoViewType.Folder;
                this.ReloadItemsCollection();
                this.OnViewChanged();
                return;
            }

            default:
            {
                return;
            }
            }
        }
コード例 #3
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;
     }
 }
コード例 #4
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));
 }
コード例 #5
0
 public SavedVideoPhotoVisualstate(VideoPhotoViewType viewtype, MultimediaFolder currentitem, SavedPlayerState playerstate) : base(playerstate)
 {
     this.ViewType    = viewtype;
     this.CurrentItem = currentitem;
 }
コード例 #6
0
        private void ReloadItemsCollection()
        {
            switch (this.ViewType)
            {
            case VideoPhotoViewType.Date:
            {
                List <Content> allFilesList = this.rootFolder.GetAllFilesList(null);
                if (allFilesList.Count < 1)
                {
                    this.ViewType = VideoPhotoViewType.NoContent;
                    return;
                }
                List <MultimediaFile> list = (
                    from x in (
                        from i in allFilesList
                        select(MultimediaFile) i).ToList <MultimediaFile>()
                    orderby x.Date descending
                    select x).ToList <MultimediaFile>();
                this.ItemsList = new ObservableCollection <ItemBase>(list);
                if (this.localPlayerVM != null)
                {
                    this.localPlayerVM.UpdateContent(this.ItemsList);
                }
                this.IsCopyPasteVisible = Visibility.Collapsed;
                return;
            }

            case VideoPhotoViewType.Title:
            {
                List <Content> contents = this.rootFolder.GetAllFilesList(null);
                if (contents.Count < 1)
                {
                    this.ViewType = VideoPhotoViewType.NoContent;
                    return;
                }
                List <MultimediaFile> multimediaFiles = (
                    from x in (
                        from i in contents
                        select(MultimediaFile) i).ToList <MultimediaFile>()
                    orderby x.Name
                    select x).ToList <MultimediaFile>();
                this.ItemsList = new ObservableCollection <ItemBase>(multimediaFiles);
                if (this.localPlayerVM != null)
                {
                    this.localPlayerVM.UpdateContent(this.ItemsList);
                }
                this.IsCopyPasteVisible = Visibility.Collapsed;
                return;
            }

            case VideoPhotoViewType.Folder:
            {
                if (this.rootFolder.GetAllFilesList(null).Count < 1)
                {
                    this.CurrentFolder = this.rootFolder;
                    this.ViewType      = VideoPhotoViewType.NoContent;
                    this.IsBackVisible = false;
                    this.OnViewChanged();
                    return;
                }
                IEnumerable <ItemBase> itemsList =
                    from arg in this.CurrentFolder.ItemsList
                    orderby arg.Date descending
                    select arg;
                this.ItemsList = new ObservableCollection <ItemBase>(itemsList);
                if (this.localPlayerVM != null)
                {
                    this.localPlayerVM.UpdateContent(this.ItemsList);
                }
                this.IsCopyPasteVisible = Visibility.Visible;
                if (this.ItemsList.Count == 0)
                {
                    this.CurrentFolder = this.rootFolder;
                    this.ReloadItemsCollection();
                    this.OnViewChanged();
                    return;
                }
                if (this.CurrentFolder != this.rootFolder)
                {
                    break;
                }
                this.IsBackVisible = false;
                return;
            }

            case VideoPhotoViewType.NoContent:
            {
                if (this.rootFolder.GetAllFilesList(null).Count <= 0)
                {
                    break;
                }
                this.ViewType = VideoPhotoViewType.Date;
                this.ReloadItemsCollection();
                break;
            }

            default:
            {
                return;
            }
            }
        }