archangelmihail

DELEGATES

Feb 12th, 2014
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.36 KB | None | 0 0
  1. DELEGATE
  2. public delegate void SimpleDelegate(string param);
  3. class ....
  4. {
  5.     SimpleDelegate d = new SimpleDelegate(TestMethod); or SimpleDelegate d = Console.ReadLine();
  6.     d += Console.ReadLine();
  7.     d("text");
  8. }
  9.  
  10. FUNCTION returns last type
  11. Func<string, int> predefinedIntParse = int.Parse;
  12.  
  13. ACTION void methods
  14. Action<object> predefinedAction = Console.WriteLine;
Advertisement
Add Comment
Please, Sign In to add comment