Anonymous methods in C#


/ Published in: C#
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.