public IVariableEntry Refresh() { if (State == VariableState.Pending) { throw new InvalidOperationException("Another refresh operation is still pending."); } if (_debugSessionContext.SelectedStackFrame == null) { throw new InvalidOperationException( $"No stack frame selected while trying to refresh {this}."); } State = VariableState.Pending; _jobQueue.Push(_refreshVariableJobFactory.Create( () => _dataSource.GetCurrentState(this, CurrentStateRetrievalCallback))); return(this); }