Exemplo n.º 1
0
 public static bool TryGetDefaultConnectionInfo(
     ConnectionInfoStore store,
     RetrieveMode mode,
     StoredConnectionInfo[] excludedConnections,
     out StoredConnectionInfo connectionInfo)
 {
     connectionInfo = (StoredConnectionInfo)null;
     if (store.Connections.Count == 0)
     {
         return(false);
     }
     StoredConnectionInfo[] connectionsByAddedDate = RemoteTargetUtils.GetAvailableConnectionsByAddedDate(store);
     connectionInfo = store.Connections.Where <StoredConnectionInfo>((Func <StoredConnectionInfo, bool>)(c => !((IEnumerable <StoredConnectionInfo>)excludedConnections).Any <StoredConnectionInfo>((Func <StoredConnectionInfo, bool>)(e => e.Id == c.Id)))).Where <StoredConnectionInfo>((Func <StoredConnectionInfo, bool>)(c => c.LastSuccessful != DateTime.MinValue)).DefaultIfEmpty <StoredConnectionInfo>(((IEnumerable <StoredConnectionInfo>)connectionsByAddedDate).FirstOrDefault <StoredConnectionInfo>()).FirstOrDefault <StoredConnectionInfo>();
     return(connectionInfo != null);
 }
Exemplo n.º 2
0
 public static StoredConnectionInfo[] GetAvailableConnectionsByAddedDate()
 {
     return(RemoteTargetUtils.GetAvailableConnectionsByAddedDate(new ConnectionInfoStore()));
 }