Guest User

Untitled

a guest
Jun 24th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. Action<List<ClubListing>> a = delegate(List<ClubListing> list)
  2. {
  3. for (int i = 0; i < list.Count; i++)
  4. {
  5. var cl = list[i];
  6. if (cl.MatchingClubListing == null)
  7. {
  8. var compare = CompareNames(cl.Club.Name);
  9. if (compare.Any(c => c.Value == 0 && c.Key.Club.State == cl.Club.State))
  10. {
  11. var match = compare.First(c => c.Value == 0 && c.Key.Club.State == cl.Club.State);
  12. compareDialog.ClubA = cl.Club;
  13. compareDialog.ClubB = match.Key.Club;
  14. DialogResult dr = compareDialog.ShowDialog();
  15. if (dr == DialogResult.Yes)
  16. {
  17. cl.MatchingClubListing = match.Key;
  18. match.Key.MatchingClubListing = cl;
  19. }
  20. else if (dr == DialogResult.Abort)
  21. {
  22. break;
  23. }
  24. }
  25. }
  26. this.Invoke(new MethodInvoker(delegate()
  27. {
  28. this.prbOperationProgress.Value = i;
  29. }));
  30. }
  31. };
  32.  
  33. AsyncCallback callback = new AsyncCallback(SaveAndUpdate);
  34. var result = a.BeginInvoke(this.lbxLiveClubs.Items.Cast<ClubListing>().ToList(), callback, null);
  35.  
  36. Form parent = ...;
  37. compareDialog.ShowDialog(parent);
Add Comment
Please, Sign In to add comment