public override void OnEntry(MethodExecutionArgs arg)
 {
     SetConstructorArgumentPrimitivesAspectMethods.Result =
         string.Format("Value: {0}, AllowedValue: {1}",
             Value,
             AllowedValue);
 }
 public override void OnEntry(MethodExecutionArgs arg)
 {
     ClassSetMethodNameAspectResult.Result =
         arg.Method == null
             ? "No method info found"
             : arg.Method.Name;
 }
 public override void OnEntry(MethodExecutionArgs arg)
 {
     SetConstructorArgumentReferencesAspectMethods.Result =
         string.Format("Type: {0}, Text: {1}",
             Type,
             Text);
 }
 public override void OnExit(MethodExecutionArgs arg)
 {
     Debug.WriteLine("SecondAspect - OnExit called for: " + arg.Method.Name);
     var value = (string)arg.MethodExecutionTag;
     Debug.WriteLine("SecondAspect - MethodExecutionTag is: " + value);
     if (value != MethodExecutionTagValue)
         throw new InvalidOperationException("SecondAspect - MethodExecutionTag was changed outside of aspect");
 }
 public override void OnEntry(MethodExecutionArgs arg)
 {
     SetNamedArgumentAspectMethods.Result =
         string.Format("Value: {0}, BoolValue: {1}, AllowedValue: {2}",
             Value,
             BoolValue,
             AllowedValue);
 }
        public override void OnEntry(MethodExecutionArgs arg)
        {
            if (arg.Instance == null)
            {
                SetInstanceValueAspectMethods.Result = "instance was null";
                return;
            }

            SetInstanceValueAspectMethods.Result = arg.Instance.ToString();
        }
        public override void OnException(MethodExecutionArgs arg)
        {
            var exception = arg.Exception;

            if (exception.GetType() == ExceptionType)
            {
                ExceptionDispatchInfo.Capture(exception).Throw();
            }

            throw new WrappedException(TranslationKey, exception.Message, exception);
        }
        public override void OnException(MethodExecutionArgs args)
        {
            var exception = args.Exception;

            if (exception.GetType() != ExceptionType)
            {
                ExceptionDispatchInfo.Capture(exception).Throw();
            }

            throw new DangerException(TranslationKey, exception);

        }
        public override void OnEntry(MethodExecutionArgs arg)
        {
            if (arg.Arguments == null)
            {
                SetArgumentValueAspectMethods.Result = "arguments was null";
                return;
            }

            SetArgumentValueAspectMethods.Result = string.Format("{0}: '{1}'",
                arg.Method.GetParameters().First().Name,
                arg.Arguments.First());
        }
 public override void OnExit(MethodExecutionArgs arg)
 {
     SetReturnValueAspectMethods.Result = arg.ReturnValue;
 }
Exemple #11
0
 public virtual void OnException(MethodExecutionArgs arg)
 {
 }
 public override void OnException(MethodExecutionArgs arg)
 {
     SetExceptionValueAspectMethods.Result = arg.Exception;
 }
 public override void OnEntry(MethodExecutionArgs arg)
 {
     PropertyAspectMethods.Result += string.Format("[{0}]", arg.Method.Name);
 }
 public override void OnEntry(MethodExecutionArgs arg)
 {
     arg.MethodExecutionTag = "MethodExecutionTag";
 }
 public override void OnExit(MethodExecutionArgs arg)
 {
     SetMethodExecutionTagValueAspectMethods.Result = arg.MethodExecutionTag;
 }
 public override void OnException(MethodExecutionArgs arg)
 {
     Debug.WriteLine("OnException called for: " + arg.Method.Name);
 }
 public override void OnEntry(MethodExecutionArgs arg)
 {
     MultipleAspectsMethods.Result += "[FirstAspect_OnEntry]";
     arg.MethodExecutionTag = "[FirstAspect_OnExit]";
 }
 public override void OnEntry(MethodExecutionArgs arg)
 {
     Console.WriteLine("LogAssemblyAttribute->Method called: " + arg.Method.Name);
 }
Exemple #19
0
 public virtual void OnEntry(MethodExecutionArgs arg)
 {
 }
 public override void OnExit(MethodExecutionArgs arg)
 {
     MultipleAspectsMethods.Result += arg.MethodExecutionTag;
 }
 public override void OnEntry(MethodExecutionArgs arg)
 {
     Debug.WriteLine("SecondAspect - OnEntry called for: " + arg.Method.Name);
     arg.MethodExecutionTag = MethodExecutionTagValue;
 }
 public override void OnEntry(MethodExecutionArgs arg)
 {
     SetAspectNameResultAspectMethods.Result = "SetAspectNameResultAspect";
 }
Exemple #23
0
 public virtual void OnExit(MethodExecutionArgs arg)
 {
 }