Posted By

karelklic on 02/28/08


Tagged

lambda closures


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

umang_nine
Priestd09


Anonymous methods in C#


 / Published in: C#
 

Important note is http://blogs.msdn.com/abhinaba/archive/2005/10/18/482180.aspx

  1. static void AddUniqe(Item item, List<Item> list)
  2. {
  3. int offs = list.FindIndex(delegate(Item i) { return i.id == item.id; });
  4. if (offs >= 0)
  5. list[offs] = item;
  6. else
  7. list.Add(item);
  8. }

Report this snippet  

You need to login to post a comment.