Esempio n. 1
0
        public void NotifyOnRevoke(object @this, IRevokeKey revokeKey, params string[] revokeKeys)
        {
            if (null == @this)
            {
                throw new NullReferenceException("Object can't be null");
            }

            if (null == revokeKey)
            {
                throw new NullReferenceException("IRevokeKey can't be null");
            }

            if (null == revokeKeys)
            {
                throw new NullReferenceException("Revoke keys can't be null");
            }

            foreach (var key in revokeKeys)
            {
                NotifyOnRevokeOnce(key, @this, revokeKey);
            }
        }
Esempio n. 2
0
 public RevokeContext(object revokee, IRevokeKey revokeKey, TaskScheduler revokeeTaskScheduler)
 {
     _revokee            = new WeakReference <object>(revokee);
     _revokeKey          = new WeakReference <IRevokeKey>(revokeKey);
     _revokeeTaskFactory = new TaskFactory(revokeeTaskScheduler);
 }
 public void SetUp()
 {
     this.subRevokeKey     = Substitute.For <IRevokeKey>();
     this.subTaskScheduler = TaskScheduler.Current;
 }
Esempio n. 4
0
        protected void NotifyOnRevokeOnce(string key, object @this, IRevokeKey revokeKey)
        {
            var newContext = new RevokeContext(@this, revokeKey, TaskScheduler.Current);

            _revokeIndexer.AddRevokeContext(key, newContext);
        }