Exemplo n.º 1
0
 /// <summary>
 /// Event triggered when the player state changes
 /// </summary>
 /// <param name="sender">event sender</param>
 /// <param name="e">event args</param>
 private void _player_EvtPlayerStateChanged(object sender, PlayerStateChangedEventArgs e)
 {
     if (EvtPlayerStateChanged != null)
     {
         var delegates = EvtPlayerStateChanged.GetInvocationList();
         foreach (var del in delegates)
         {
             var playerstateChanged = (PlayerStateChanged)del;
             playerstateChanged.BeginInvoke(sender, e, null, null);
         }
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Sets the state of the player and triggers event
        /// that the state changed
        /// </summary>
        /// <param name="playerState">new state</param>
        private void setPlayerState(PlayerState playerState)
        {
            Log.Debug();

            PlayerState oldState = _playerState;

            if (oldState != playerState)
            {
                Log.Debug(_rootWidget.Name + ":Set player state to " + playerState);
                _playerState = playerState;
                if (EvtPlayerStateChanged != null)
                {
                    Log.Debug("Calling evtPlayerStateChanged");
                    EvtPlayerStateChanged.BeginInvoke(this, new PlayerStateChangedEventArgs(oldState, _playerState), null, null);
                }
            }
        }