Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dynamicMethodGeneration(
- //normal processing lambda
- (stringParam1, stringParam2, boolParam1, boolParam1) =>
- {
- Console.WriteLine(stringParam1);
- Console.WriteLine(stringParam2);
- return true;
- },
- //error processing lambda
- (stringParam1, stringParam2, boolParam1, boolParam1) =>
- {
- Console.WriteLine(stringParam1);
- Console.WriteLine(stringParam2);
- return false;
- },
- true , false);
- public static bool dynamicMethodGeneration(Func<String, String, bool, bool, returnBool> normalProcessing,
- Func<String, String, bool, bool, returnBool> errorProcessing, bool error, bool normal)
- {
- IWebElement returnElement = null;
- if (error)//PROCESSING ON ERROR
- {
- return errorProcessing(new String("Hello World Normal 1."), new String("Hello World Normal 2."), true, false);
- }//NORMAL PROCESSING
- else if (normal)
- {
- return normalProcessing(new String("Hello World Error 1."), new String("Hello World Error 2."), true, false);
- }
- }
Add Comment
Please, Sign In to add comment