Example #1
0
 public Promise(Exception exception)
 {
     Exception    = exception ?? throw new ArgumentNullException(nameof(exception));
     _hashCode    = Exception.GetHashCode();
     WaitHandle   = new ManualResetEventSlim(true);
     _onCompleted = new StrongDelegateCollection(true);
 }
Example #2
0
 public Promise(Exception exception)
 {
     Exception    = exception;
     _hashCode    = exception.GetHashCode();
     _waitHandle  = new ManualResetEventSlim(true);
     _onCompleted = new StrongDelegateCollection(true);
 }
Example #3
0
        public Promise(bool done)
        {
            Exception = null;
            _hashCode = base.GetHashCode();
            if (!done)
            {
                WaitHandle = new ManualResetEventSlim(false);
            }

            _onCompleted = new StrongDelegateCollection(true);
        }
Example #4
0
        public Needle(T target)
        {
            if (target == null)
            {
                _target   = null;
                _hashCode = base.GetHashCode();
            }
            else
            {
                _target   = new StructNeedle <T>(target);
                _hashCode = target.GetHashCode();
            }

            _onCompleted = new StrongDelegateCollection(true);
        }
Example #5
0
        private INeedle <T> _target; // Can be null - set in SetTargetValue and SetTargetError

        public Needle()
        {
            _target      = null;
            _hashCode    = base.GetHashCode();
            _onCompleted = new StrongDelegateCollection(true);
        }