Пример #1
0
 public bool Lock(Cell[] cells)
 {
     if (cells.All(c => string.IsNullOrEmpty(c.LockTag)))
     {
         try
         {
             cells.AsParallel().ForAll(c => c.LockTag = this.LockKey);
             StorageRepository.SaveChanges();
             return true;
         }
         catch (Exception)
         {
             return false;
         }
     }
     else
     {
         return false;
     }
 }
Пример #2
0
 public void UnLock(Cell[] cells)
 {
     try
     {
         cells.AsParallel().ForAll(c => c.LockTag = string.Empty);
         CellRepository.SaveChanges();
     }
     catch (Exception)
     {
         return;
     }
 }