Esempio n. 1
0
 public void Advise(ParameterAdviceContext context)
 {
     if (context.IsIn)
     {
         if (context.ParameterType == typeof(int))
             context.SetValue(context.GetValue<int>() + 1);
         if (context.ParameterType == typeof(string))
             context.SetValue(context.GetValue<string>() + "there");
     }
     context.Proceed();
     if (context.IsOut && !context.IsIn)
         context.SetValue(context.GetValue<int>() * 2);
 }
Esempio n. 2
0
 public void Advise(ParameterAdviceContext context)
 {
     if (context.IsIn)
     {
         if (context.ParameterType == typeof(int))
         {
             context.SetValue(context.GetValue <int>() + 1);
         }
         if (context.ParameterType == typeof(string))
         {
             context.SetValue(context.GetValue <string>() + "there");
         }
     }
     context.Proceed();
     if (context.IsOut && !context.IsIn)
     {
         context.SetValue(context.GetValue <int>() * 2);
     }
 }