Esempio n. 1
0
 private void Pause()
 {
     if (FullScreenImage.Visibility == Visibility.Visible)
     {
         if (imageTimer.IsEnabled)
         {
             imageTimer.Stop();
         }
         else
         {
             HideError();
             imageTimer.Start();
         }
     }
     else
     {
         if (GetMediaState(FullScreenMedia) == MediaState.Play)
         {
             FullScreenMedia.Pause();
         }
         else
         {
             HideError();
             FullScreenMedia.Play();
         }
     }
 }
Esempio n. 2
0
        private void ScrKeyDown(object sender, KeyEventArgs e)
        {
            switch (e.Key)
            {
            case Key.Up:
            case Key.VolumeUp:
                volume += 0.1;
                break;

            case Key.Down:
            case Key.VolumeDown:
                volume -= 0.1;
                break;

            case Key.VolumeMute:
            case Key.D0:
                volume = 0;
                break;

            case Key.Right:
                imageTimer.Stop();
                NextMediaItem();
                break;

            case Key.Left:
                imageTimer.Stop();
                PrevMediaItem();
                break;

            case Key.P:
                Pause();
                break;

            case Key.Delete:
                imageTimer.Stop();
                FullScreenMedia.Pause();
                PromtDeleteCurrentMedia();
                break;

            case Key.I:
                Overlay.Visibility = Overlay.Visibility == Visibility.Visible
                        ? Visibility.Collapsed
                        : Visibility.Visible;
                break;

            case Key.H:
            case Key.OemQuestion:
                ShowUsage();
                break;

            case Key.R:
                FileInfo fi = new FileInfo(mediaFiles[currentItem]);
                if (acceptedExtensionsImages.Contains(fi.Extension.ToLower()))     // Only rotate images
                {
                    RotateImage();
                }
                break;

            case Key.S:
                ShowInFolder();
                break;

            default:
                EndFullScreensaver();
                break;
            }
        }