void media_MediaFailed(object sender, ExceptionRoutedEventArgs e) { SendEvent(e.ToString()); }
/// <summary> /// Event handler for the media failed event from the media element. /// </summary> /// <param name="sender">Source of the event.</param> /// <param name="e">Event args.</param> void OnMediaElementMediaFailed(object sender, ExceptionRoutedEventArgs e) { Debug.WriteLine("OnMediaElementMediaFailed:" + e.ToString()); string strErrorMessage = string.Empty; if (m_mediaElement.Source != null) { strErrorMessage = m_mediaElement.Source.ToString(); } else if (m_currentPlaylistIndex >= 0 && m_currentPlaylistIndex < Playlist.Count) { strErrorMessage = Playlist[m_currentPlaylistIndex].MediaUrl.ToString(); } strErrorMessage += "\r\n" + e.ErrorException.ToString(); if (m_currentPlaylistIndex >= 0 && m_currentPlaylistIndex < Playlist.Count && Playlist[m_currentPlaylistIndex].IsAdaptiveStreaming) { strErrorMessage += "\r\nRequires output to be hosted on a web server running IIS 7.0 with the Smooth Streaming handler installed and a Silverlight 2 template that supports Smooth Streaming."; } ShowErrorMessage(strErrorMessage); }
/// <summary> /// Event handler for the Image failed event from the image. /// </summary> /// <param name="sender">Source of the event.</param> /// <param name="e">Event args.</param> private void OnImageFailed(object sender, ExceptionRoutedEventArgs e) { Debug.WriteLine("OnImageFailed:" + e.ToString()); string strErrorMessage = e.ErrorException.ToString() + "\r\n"; if (this.Source != null) { strErrorMessage += this.Source.ToString() + "\r\n"; } TextBlock textBlock = new TextBlock(); textBlock.Text = strErrorMessage; textBlock.TextWrapping = TextWrapping.Wrap; Content = textBlock; }
private void me_MediaFailed(object sender, ExceptionRoutedEventArgs e) { TaskbarItemInfo.Overlay = (ImageSource)Resources["ErrorImage"]; MessageBox.Show("ERROR: " + e.ToString()); }