Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace CSharpTests
- {
- class Program
- {
- private static event Action myEvent = delegate { };
- static void Main(string[] args)
- {
- for(int i = 0; i < 100; i++)
- {
- var jj = i.ToString();
- myEvent += () => { Console.WriteLine(string.Format("Line {0}: {1}",jj,i)); };
- }
- myEvent();
- Console.Read();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement