Source/NFX/ApplicationModel/Volatile/ObjectStoreService.cs
/// <summary>
/// Puts an object back into store identified by the "key".
/// The object is written in the provider when call count to this method equals to CheckOut().
/// Returns true if object with such id exists and was checked-in
/// </summary>
Puts an object back into store identified by the "key".
The object is written in the provider when call count to this method equals to CheckOut().
Returns true if object with such id exists and was checked-in
Puts an object back into store identified by the " key " . The object is written in the provider when call count to this method equals to CheckOut () . Returns true if object with such id exists and was checked - in
public bool CheckIn(Guid key, int msTimeout = 0)
    {
      if (Status != ControlStatus.Active) return false;
      var bucket = getBucket(key);
      ObjectStoreEntry entry = null;
      lock (bucket)
        if (!bucket.TryGetValue(key, out entry))
          return false;
        lock (entry)
        {
          if (entry.Status == ObjectStoreEntryStatus.Deleted) return false;
          if (entry.CheckoutCount>0)
          {
           entry.CheckoutCount--;
           if (entry.CheckoutCount==0)
            entry.Status = ObjectStoreEntryStatus.ChekedIn;
          }
          entry.LastTime = App.LocalizedTime;
          entry.MsTimeout = msTimeout;
        }
      return true;
    }
public bool CheckIn ( Guid key , int msTimeout = 0 ) { if ( Status != ControlStatus . Active ) return false ; var bucket = getBucket ( key ) ; ObjectStoreEntry entry = null ; lock ( bucket ) if ( ! bucket . TryGetValue ( key , out entry ) ) return false ; lock ( entry ) { if ( entry . Status == ObjectStoreEntryStatus . Deleted ) return false ; if ( entry . CheckoutCount > 0 ) { entry . CheckoutCount -- ; if ( entry . CheckoutCount == 0 ) entry . Status = ObjectStoreEntryStatus . ChekedIn ; } entry . LastTime = App . LocalizedTime ; entry . MsTimeout = msTimeout ; } return true ; }
Puts an object back into store identified by the "key".
Puts an object back into store identified by the " key " .
key
Guid
msTimeout
int