コード例 #1
0
        private void getValue()
        {
            if (Configuration.TrackComputingsExecutingUserCode)
            {
                Thread     currentThread = Thread.CurrentThread;
                IComputing computing     = DebugInfo._computingsExecutingUserCode.ContainsKey(currentThread)
                                        ? DebugInfo._computingsExecutingUserCode[currentThread]
                                        : null;
                DebugInfo._computingsExecutingUserCode[currentThread] = this;
                _userCodeIsCalledFrom = computing;

                _value = _getter(_propertyHolder);

                if (computing == null)
                {
                    DebugInfo._computingsExecutingUserCode.TryRemove(currentThread, out IComputing _);
                }
                else
                {
                    DebugInfo._computingsExecutingUserCode[currentThread] = computing;
                }
                _userCodeIsCalledFrom = null;
            }
            else
            {
                _value = _getter(_propertyHolder);
            }
        }
コード例 #2
0
        private TResult getResult()
        {
            TResult result;

            if (Configuration.TrackComputingsExecutingUserCode)
            {
                Thread     currentThread = Thread.CurrentThread;
                IComputing computing     = DebugInfo._computingsExecutingUserCode.ContainsKey(currentThread)
                                        ? DebugInfo._computingsExecutingUserCode[currentThread]
                                        : null;
                DebugInfo._computingsExecutingUserCode[currentThread] = this;
                _userCodeIsCalledFrom = computing;

                result = _getValueFunc();

                if (computing == null)
                {
                    DebugInfo._computingsExecutingUserCode.TryRemove(currentThread, out IComputing _);
                }
                else
                {
                    DebugInfo._computingsExecutingUserCode[currentThread] = computing;
                }
                _userCodeIsCalledFrom = null;
            }
            else
            {
                result = _getValueFunc();
            }

            return(result);
        }
コード例 #3
0
        private TReturnValue processNewValue(TValue newValue)
        {
            if (Configuration.TrackComputingsExecutingUserCode)
            {
                Thread     currentThread = Thread.CurrentThread;
                IComputing computing     = DebugInfo._computingsExecutingUserCode.ContainsKey(currentThread)
                                        ? DebugInfo._computingsExecutingUserCode[currentThread]
                                        : null;
                DebugInfo._computingsExecutingUserCode[currentThread] = this;
                _userCodeIsCalledFrom = computing;

                TReturnValue returnValue = _newValueProcessor(newValue, this, _returnValue);

                if (computing == null)
                {
                    DebugInfo._computingsExecutingUserCode.TryRemove(currentThread, out IComputing _);
                }
                else
                {
                    DebugInfo._computingsExecutingUserCode[currentThread] = computing;
                }
                _userCodeIsCalledFrom = null;

                return(returnValue);
            }
            else
            {
                return(_newValueProcessor(newValue, this, _returnValue));
            }
        }
コード例 #4
0
        internal Invocation(Action <object> actionWithState, object state, OcDispatcher ocDispatcher, InvocationStatus invocationStatus, IComputing context = null, ManualResetEventSlim doneManualResetEvent = null) : this()
        {
            _actionWithState      = actionWithState;
            _state                = state;
            _ocDispatcher         = ocDispatcher;
            _context              = context;
            InvocationStatus      = invocationStatus;
            _doneManualResetEvent = doneManualResetEvent;


            if (Configuration.SaveOcDispatcherInvocationStackTrace)
            {
                _callStackTrace = Environment.StackTrace;
            }
        }
コード例 #5
0
        internal Invocation(Action <object> actionWithState, object state, Dispatcher dispatcher, IComputing context = null) : this()
        {
            _actionWithState = actionWithState;
            _state           = state;
            _dispatcher      = dispatcher;
            _context         = context;

            if (Configuration.SaveDispatcherInvocationStackTrace)
            {
                _callStackTrace = Environment.StackTrace;
            }
        }
コード例 #6
0
 public ObservableComputationsInconsistencyException(IComputing computing, string message, object eventSender, EventArgs eventArgs) : base(computing, message)
 {
     _eventSender = eventSender;
     _eventArgs   = eventArgs;
 }
コード例 #7
0
 public ObservableComputationsException(IComputing computing, string message) : base(message)
 {
     _computing = computing;
 }