Beispiel #1
0
        //the Panel controls buttons
        public void PlaybackControl(MediaEventArgs m)
        {
            string desctiption = m.getDescription();

            if (desctiption == "submit")
            {
                _panel.SetSpeed(m.getValue());
            }
            else if (desctiption == "skip back")
            {
                VM_Num_line = 0;
            }
            else if (desctiption == "back")
            {
                if (VM_Num_line >= 75)
                {
                    VM_Num_line -= 75;
                }
                else
                {
                    VM_Num_line = 0;
                }
            }
            else if (desctiption == "pause")
            {
                _panel.Pause();
            }
            else if (desctiption == "stop")
            {
                VM_Num_line = 0;
                Thread.Sleep(10);
                _panel.Pause();
            }
            else if (desctiption == "play")
            {
                _panel.Play();
            }
            else if (desctiption == "forward")
            {
                if (VM_Num_line < VM_LinesN - 75)
                {
                    VM_Num_line += 75;
                }
                else
                {
                    VM_Num_line = VM_LinesN - 1;
                }
            }
            else if (desctiption == "skip end")
            {
                VM_Num_line = VM_LinesN - 1;
            }
        }
 public void OnPress(Object sender, EventArgs e)
 {
     if (e.GetType().Equals(typeof(MediaEventArgs)))
     {
         MediaEventArgs m = (MediaEventArgs)e;
         this._VMPanel.PlaybackControl(m);
     }
     else if (e.GetType().Equals(typeof(GraphEventArgs)))
     {
         GraphEventArgs m = (GraphEventArgs)e;
         this._VMPanel.GraphControls(m);
     }
 }