Archive

Custom Attributes That Handles Exceptions

public class ExceptionDialogAttribute : OnExceptionAspect
{
  public override void OnException(MethodExecutionEventArgs eventArgs)
  {
    string message = eventArgs.Exception.Message;
    Window window = Window.GetWindow((DependencyObject) eventArgs.Instance);
    MessageBox.Show(window, message, "Exception");
   
eventArgs.FlowBehavior = FlowBehavior.Continue;
  }

}

Comments are closed