本文整理汇总了C#中System.Windows.ExceptionRoutedEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ExceptionRoutedEventArgs类的具体用法?C# ExceptionRoutedEventArgs怎么用?C# ExceptionRoutedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ExceptionRoutedEventArgs类属于System.Windows命名空间,在下文中一共展示了ExceptionRoutedEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: img_ImageFailed
static void img_ImageFailed(object sender, ExceptionRoutedEventArgs e)
{
BitmapImage img = sender as BitmapImage;
img.ImageFailed -= new EventHandler<ExceptionRoutedEventArgs>(img_ImageFailed);
img.ImageOpened -= new EventHandler<RoutedEventArgs>(img_ImageOpened);
loadCount--;
}
示例2: Image_ImageFailed
static void Image_ImageFailed([NotNull] object sender, ExceptionRoutedEventArgs e)
{
Contract.Requires(sender != null);
var resourceKey = GetResourceKey((Image)sender);
var message = e.ErrorException.Maybe().Return(ex => ex.Message, @"No exception");
Trace.TraceError(string.Format(CultureInfo.InvariantCulture, "Load image with resource key '{0}' failed: {1}", resourceKey, message));
}
示例3: element_MediaFailed
void element_MediaFailed(object sender, ExceptionRoutedEventArgs e)
{
if (MediaFailed != null)
{
MediaFailed(sender, e);
}
}
示例4: imageContent_ImageFailed
private void imageContent_ImageFailed(object sender, ExceptionRoutedEventArgs e)
{
var img = sender as Image;
img.Opacity = 1;
System.Windows.Media.Imaging.BitmapImage bm = new System.Windows.Media.Imaging.BitmapImage(new Uri(@"/Assets/Images/NoImage.png", UriKind.RelativeOrAbsolute));
imageContent.Source = bm;
}
示例5: bs_ImageFailed
private void bs_ImageFailed(object sender, ExceptionRoutedEventArgs args)
{
FailedToLoad = true;
Loader.AddLoadableException(new Exception("ImageSilverlight - Failed to load image."));
if (loadedCallback != null) loadedCallback(this, false);
loadedCallback = null;
}
示例6: player_MediaFailed
private void player_MediaFailed(object sender, ExceptionRoutedEventArgs e) {
stateDisplay.State=PlaybackState.Stopped;
player.Source=null;
if (server != null) { server.Stop(); server.Start(); }
player.Source=playerSource;
player.Play();
stateDisplay.State=PlaybackState.Connecting;
}
示例7: ImageFailed
private void ImageFailed(object sender, ExceptionRoutedEventArgs e)
{
_bitmapImage.ImageOpened -= ImageOpened;
_bitmapImage.ImageFailed -= ImageFailed;
_tcs.SetException(e.ErrorException);
_handle.Free();
}
示例8: GetImageSourceImageFailed
private static void GetImageSourceImageFailed(object sender, ExceptionRoutedEventArgs e)
{
var image = sender as Image;
if (image != null)
{
image.Source = null;
image.ImageFailed -= GetImageSourceImageFailed;
}
}
示例9: ItemImage_ImageFailed
public void ItemImage_ImageFailed(object o, ExceptionRoutedEventArgs e)
{
ItemImage.ImageFailed -= new EventHandler<ExceptionRoutedEventArgs>(ItemImage_ImageFailed);
#if DEBUG
//TalentImage_ImageFailed2(o, e); // Tell me what happened
//TalentImage.ImageFailed += new EventHandler<ExceptionRoutedEventArgs>(TalentImage_ImageFailed2);
#endif
// Getting the Image from the Armory failed, lets try another source
if (itemInstance != null)
{
ItemImage.Source = Icons.AnIcon(ItemInstance.Item.IconPath);
}
else if (NonItemImageSource != null)
{
ItemImage.Source = Icons.AnIcon(NonItemImageSource);
}
}
示例10: Image_ImageFailed
private void Image_ImageFailed(object sender, ExceptionRoutedEventArgs e)
{
Image img = sender as Image;
RotateTransform rotateTransform = img.RenderTransform as RotateTransform;
// Create and define animation
DoubleAnimation anima = new DoubleAnimation();
anima.From = 0;
anima.To = 360;
anima.Duration = new Duration(TimeSpan.FromSeconds(0.5));
// Set attached properties
Storyboard.SetTarget(anima, rotateTransform);
Storyboard.SetTargetProperty(anima, new PropertyPath(RotateTransform.AngleProperty));
// Create storyboard, add animation, and fire it up!
Storyboard storyboard = new Storyboard();
storyboard.Children.Add(anima);
storyboard.Begin();
}
示例11: MediaElementOnMediaFailed
private void MediaElementOnMediaFailed(object sender, ExceptionRoutedEventArgs args)
{
if (_textBlockError == null) {
_textBlockError = new TextBlock {
Foreground = Brushes.White,
FontSize = 14,
Margin = new Thickness(2),
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Top,
TextWrapping = TextWrapping.WrapWithOverflow,
Effect = new DropShadowEffect {
ShadowDepth = 0,
Color = Colors.Black,
BlurRadius = 8
}
};
((Grid) Content).Children.Add(_textBlockError);
}
_textBlockError.Text = $"Playing {_mediaElement.Source} failed.\n{args.ErrorException.Message}";
}
示例12: Image1_ImageFailed
private void Image1_ImageFailed(object sender, ExceptionRoutedEventArgs e)
{
MessageBox.Show("Error Sucker");
}
示例13: pictureBoxWaveForm_ImageFailed
private void pictureBoxWaveForm_ImageFailed(object sender, ExceptionRoutedEventArgs e)
{
}
示例14: OnMediaFailed
private void OnMediaFailed(object sender, ExceptionRoutedEventArgs e)
{
System.Diagnostics.Debug.WriteLine("SoundManager: Media failed. {0}", e.ErrorException.Message);
lock (_syncRoot)
{
_isPlaying = false;
}
}
示例15: mediaElement_MediaFailed
private void mediaElement_MediaFailed(object sender, ExceptionRoutedEventArgs e)
{
MessageBox.Show(e.ErrorException.Message, "Media Failure", MessageBoxButton.OK);
}