Advertisement
Guest User

Untitled

a guest
Sep 17th, 2014
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.82 KB | None | 0 0
  1.     class TestScript : BaseScript
  2.     {
  3.         public TestScript()
  4.         {
  5.             EventHandlers["getMapDirectives"] += new Action<dynamic>(add =>
  6.             {
  7.                 Func<dynamic, string, Action<string>> addCB = (state, key) =>
  8.                 {
  9.                     Debug.WriteLine("adding key {0}", key);
  10.  
  11.                     return new Action<string>(value =>
  12.                     {
  13.                         Debug.WriteLine("and key + value = {0} {1}", key, value);
  14.  
  15.                         state.add("key", key);
  16.                     });
  17.                 };
  18.  
  19.                 Action<dynamic> removeCB = (state) =>
  20.                 {
  21.                     Debug.WriteLine("removing key {0}", state.key);
  22.                 };
  23.  
  24.                 add("banana", addCB, removeCB);
  25.             });
  26.         }
  27.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement