Guest User

Untitled

a guest
Jan 18th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. [Intercept]
  2. public string Method1(POS pos, int param1, string param2)
  3. {
  4. return String.Format("{0}: {1}", param1,param2);
  5. }
  6.  
  7. [Intercept]
  8. public int Method2(POS pos, int param3)
  9. {
  10. return param3 * 2;
  11. }
  12.  
  13. public void OnPreProcessing(...)
  14. {
  15. // Before Mothod1 and Method2 called, It should enter here
  16. // I want to be able to cancel method execution and return another value.
  17. // I want to get the method name, parameter names and values
  18. }
  19.  
  20. public IMessage SyncProcessMessage(IMessage msg)
  21. {
  22. var mcm = msg as IMethodCallMessage;
  23. OnPreProcessing(ref mcm);
  24. var retMsg = _NextSink.SyncProcessMessage(msg) as IMethodReturnMessage;
  25. OnPostProcessing(mcm, ref retMsg);
  26. return retMsg;
  27. }
Add Comment
Please, Sign In to add comment