private void OnPlayerEvent (PlayerEventArgs args)
{
switch (args.Event) {
case PlayerEvent.Error:
case PlayerEvent.EndOfStream:
ToggleAction stop_action = (ToggleAction) this["StopWhenFinishedAction"];
// Kinda lame, but we don't want to actually reset StopWhenFinished inside the controller
// since it is also listening to EOS and needs to actually stop playback; we listen here
// just to keep the UI in sync.
stop_action.Activated -= OnStopWhenFinishedAction;
stop_action.Active = false;
stop_action.Activated += OnStopWhenFinishedAction;
break;
case PlayerEvent.StateChange:
OnPlayerStateChange ((PlayerEventStateChangeArgs)args);
break;
}
}