Exemplo n.º 1
0
 public List <UserDetails> GetUsers()
 {
     try
     {
         GroupLock.EnterReadLock();
         return(Users.Values.ToList());
     }
     finally
     {
         GroupLock.ExitReadLock();
     }
 }
Exemplo n.º 2
0
 public bool TryGetUser(string connectionid, out UserDetails userdetails)
 {
     try
     {
         GroupLock.EnterReadLock();
         if (Users.TryGetValue(connectionid, out userdetails))
         {
             return(true);
         }
         return(false);
     }
     finally
     {
         GroupLock.ExitReadLock();
     }
 }
Exemplo n.º 3
0
 public void ClearCodeAndRatings()
 {
     try
     {
         GroupLock.EnterReadLock();
         foreach (var userdetail in Users.Values)
         {
             userdetail.Code     = "";
             userdetail.Rating   = Single.MaxValue;
             userdetail.Attempts = 0;
         }
     }
     finally
     {
         GroupLock.ExitReadLock();
     }
 }