Beispiel #1
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;
     }
 }
Beispiel #2
0
        private void OnDragItem(object obj)
        {
            if (obj is ItemBase)
            {
                ItemBase itemBase = obj as ItemBase;
                if (itemBase == null)
                {
                    return;
                }
                if (itemBase.Type != ItemType.Content)
                {
                    MultimediaFolder multimediaFolder = obj as MultimediaFolder;
                    DragDrop.DoDragDrop(new UIElement(), multimediaFolder.GetAllFilesList(null), DragDropEffects.Copy);
                    return;
                }
                List <Content> contents = new List <Content>()
                {
                    obj as Content
                };
                DragDrop.DoDragDrop(new UIElement(), contents, DragDropEffects.Copy);
                return;
            }
            IEnumerable <object> objs = obj as IEnumerable <object>;

            if (objs != null)
            {
                Content[] array = objs.OfType <Content>().ToArray <Content>();
                if (array.Count <Content>() > 0)
                {
                    DragDrop.DoDragDrop(new UIElement(), array, DragDropEffects.Copy);
                    return;
                }
                MultimediaFolder[] multimediaFolderArray = objs.OfType <MultimediaFolder>().ToArray <MultimediaFolder>();
                if (multimediaFolderArray.Count <MultimediaFolder>() > 0)
                {
                    IEnumerable <Content> contents1 = ((IEnumerable <MultimediaFolder>)multimediaFolderArray).SelectMany <MultimediaFolder, Content>((MultimediaFolder p) => p.GetFilesList());
                    DragDrop.DoDragDrop(new UIElement(), contents1, DragDropEffects.Copy);
                }
            }
        }