Exemplo n.º 1
0
        void MediaControl_MediaOpened(object sender, System.Windows.RoutedEventArgs e)
        {
            if (!MediaControl.NaturalDuration.HasTimeSpan)
            {
                MediaControl.Pause();

                BackgroundWorker bwImageDelay = new BackgroundWorker()
                {
                    WorkerSupportsCancellation = true
                };
                bwImageDelay.DoWork += (bs, barg) =>
                {
                    System.Threading.Thread.Sleep(new TimeSpan(0, 0, 30));
                };

                bwImageDelay.RunWorkerCompleted += (bs, barg) =>
                {
                    if (!MediaControl.NaturalDuration.HasTimeSpan)
                    {
                        Load_New_Media();
                    }
                };
                bwImageDelay.RunWorkerAsync();
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 一時停止
 /// </summary>
 public void Pause()
 {
     CheckAlive();
     Status = GraphState.Paused;
     MediaControl.Pause();
     if (MediaPause != null)
     {
         MediaPause(this, EventArgs.Empty);
     }
 }
Exemplo n.º 3
0
        void MainEvent_OnDataConfirm(object obj)
        {
            if (obj != null)
            {
                if (((BOL.Task.objTask)obj).terminal_id == null)
                {
                    switch (((BOL.Task.objTask)obj).type)
                    {
                    case BOL.Task.objTask.MessageType.ChangeMedia:
                        Load_New_Media();
                        break;

                    case BOL.Task.objTask.MessageType.Play:
                        MediaControl.Play();
                        break;

                    case BOL.Task.objTask.MessageType.Pause:
                        MediaControl.Pause();
                        break;

                    case BOL.Task.objTask.MessageType.Mute:
                        MediaControl.IsMuted = true;
                        break;

                    case BOL.Task.objTask.MessageType.Unmute:
                        MediaControl.IsMuted = false;
                        break;

                    case BOL.Task.objTask.MessageType.LoadTerminals:
                        Update_Terminal_List();
                        break;

                    default:
                        //nothing
                        break;
                    }
                    ;
                }
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Invoked when the Pause command is executed
 /// </summary>
 /// <param name="sender">Sender</param>
 private void DoPause(object sender)
 {
     MediaControl.Pause();
 }