コード例 #1
0
 private void Next_enabled(object sender, CanExecuteRoutedEventArgs e)
 {
     if (FilePlayerManager.MediaControllerViewModel.IsfetchingRepeatItemAsync)
     {
         e.CanExecute = false;
     }
     e.CanExecute = MediaControllerViewModel.CanNext();
 }
コード例 #2
0
 private void FastForward_executed(object sender, ExecutedRoutedEventArgs e)
 {
     ReWindFastForward();
     MediaPlayerService.CurrentTimer += TimeSpan.FromMilliseconds(10000);
     MediaControllerViewModel.TimeChangeAction();
     if (e.OriginalSource is Button)
     {
         RestoreMediaState();
     }
 }
コード例 #3
0
 private void AddSubtitleFileAction(string[] filePathInfo)
 {
     for (int i = 0; i < filePathInfo.Length; i++)
     {
         FileInfo file = new FileInfo(filePathInfo[i]);
         if (file.Extension == ".srt")
         {
             MediaControllerViewModel.SetSubtitle(file.FullName);
         }
     }
 }
コード例 #4
0
        public void OnDrop(DragEventArgs e)
        {
            VideoFolder vf = (VideoFolder)e.Data.GetData(typeof(VideoFolder));

            if (vf == null)
            {
                vf = (VideoFolder)e.Data.GetData(typeof(VideoFolderChild));
            }
            if (vf == null)
            {
                if (MediaControllerViewModel.CurrentVideoItem != null)
                {
                    String[] filePathInfo = (String[])e.Data.GetData("FileName", false);
                    AddSubtitleFileAction(filePathInfo);
                    return;
                }
            }
            if (vf.FileType == FileType.Folder)
            {
                VideoFolder vfc = null;
                foreach (VideoFolder item in vf.OtherFiles)
                {
                    if (item.FileType == FileType.File)
                    {
                        vfc = item;
                        break;
                    }
                }
                if (vfc == null)
                {
                    return;
                }
                MediaControllerViewModel.GetVideoItem(vfc as VideoFolderChild);
                return;
            }
            MediaControllerViewModel.GetVideoItem(vf as VideoFolderChild);
            CommandManager.InvalidateRequerySuggested();
        }
コード例 #5
0
 private void ShiftRewind_executed(object sender, ExecutedRoutedEventArgs e)
 {
     ReWindFastForward();
     MediaPlayerService.CurrentTimer -= TimeSpan.FromMilliseconds(1500);
     MediaControllerViewModel.TimeChangeAction();
 }