public bool ObjectEqual(RevokeContext entry) { if (entry == null) { return(false); } var ourObj = Revokee; var theirObj = entry.Revokee; return(ObjectEqualInternal(ourObj, theirObj)); }
public void AddRevokeContext(string key, RevokeContext context) { if (key == null) { throw new NullReferenceException("Key can't be null"); } if (context == null) { throw new NullReferenceException("Context can't be null"); } var collection = _entries.GetOrAdd(key, _ => _contextCollectionFactory.Create()); collection.Insert(context); }
public void Insert(RevokeContext context) { if (context == null) { throw new NullReferenceException("RevokeContext can not be null"); } var revokee = context.Revokee; if (revokee != null) { var key = new EquatableWeakReference <object>(revokee); var value = context; //Override _collection.AddOrUpdate(key, value, (_, __) => value); } }
protected void NotifyOnRevokeOnce(string key, object @this, IRevokeKey revokeKey) { var newContext = new RevokeContext(@this, revokeKey, TaskScheduler.Current); _revokeIndexer.AddRevokeContext(key, newContext); }
protected void NotifyOnRevokeOnce(string key, object @this, Func <string, Task> callback) { var newContext = new RevokeContext(@this, callback, TaskScheduler.Current); _revokeIndexer.AddRevokeContext(key, newContext); }