Guest User

Untitled

a guest
Jun 14th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | None | 0 0
  1. private IEnumerable<DisconnectedPollingFanOutJobEntry> HostsAndGuestsView
  2.         {
  3.             get
  4.             {
  5.                 return Hosts
  6.                     .Select(e => e as DisconnectedPollingFanOutJobEntry)
  7.                     //because we are dotnet 3.5 we can't use covariances
  8.                     .Concat(Guests.Select(e => e as DisconnectedPollingFanOutJobEntry));
  9.                     //so this as good as it gets.                          
  10.             }
  11.         }
  12.  
  13. and then i'd use it like
  14.  
  15. while (!CancelQueue &&
  16.                   HostsAndGuestsView.Any(
  17.                       e =>
  18.                       e.DisconnectedJobState == DisconnectedPollingFanoutJobState.Pending ||
  19.                       e.DisconnectedJobState == DisconnectedPollingFanoutJobState.Running)
  20.                )
Add Comment
Please, Sign In to add comment