using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.Windows;
using System.Reflection;
using Proxies;

namespace BeWo.ServiceProxy
{
    public class ServiceExceptionHandlingInterceptor : InvocationHandler
    {
        public void AfterMethodInvocationWithException(MethodContextInfo CurrentMethod, Exception GeneratedException, ref bool BubbleGeneratedException, ref bool BubbleException)
        {
            //TODO: SERVICE EXCEPTION HANDLING
            MessageBox.Show(GeneratedException.InnerException.Message);
            BubbleException = false;
        }

        public void BeforeMethodInvocation(MethodContextInfo CurrentMethod, ref object[] MethodArgs, ref bool CallMethod, ref bool BubbleException) { }

        public void AfterMethodInvocation(MethodContextInfo CurrentMethod, ref object[] MethodArgs, ref object ReturnValue, ref bool BubbleException) { }

    }
}
