Guest User

Untitled

a guest
Oct 19th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. dynamicMethodGeneration(
  2. //normal processing lambda
  3. (stringParam1, stringParam2, boolParam1, boolParam1) =>
  4. {
  5. Console.WriteLine(stringParam1);
  6. Console.WriteLine(stringParam2);
  7. return true;
  8. },
  9. //error processing lambda
  10. (stringParam1, stringParam2, boolParam1, boolParam1) =>
  11. {
  12. Console.WriteLine(stringParam1);
  13. Console.WriteLine(stringParam2);
  14. return false;
  15. },
  16. true , false);
  17.  
  18.  
  19. public static bool dynamicMethodGeneration(Func<String, String, bool, bool, returnBool> normalProcessing,
  20. Func<String, String, bool, bool, returnBool> errorProcessing, bool error, bool normal)
  21. {
  22. IWebElement returnElement = null;
  23.  
  24. if (error)//PROCESSING ON ERROR
  25. {
  26. return errorProcessing(new String("Hello World Normal 1."), new String("Hello World Normal 2."), true, false);
  27. }//NORMAL PROCESSING
  28. else if (normal)
  29. {
  30. return normalProcessing(new String("Hello World Error 1."), new String("Hello World Error 2."), true, false);
  31. }
  32. }
Add Comment
Please, Sign In to add comment