public object Get(string key, IMetadata metadata) { if (!_cached) { if (_symbol == null) { _value = null; } else if (!_visitor.TryGetDocument(_symbol, out _value)) { // Visit the symbol and try again _symbol.Accept(_visitor); if (!_visitor.TryGetDocument(_symbol, out _value)) { _value = null; } } _cached = true; } return(_value); }
public object Get(string key, IMetadata metadata) { if (!_cached) { _values = _symbols .Where(x => x != null) .Select(x => { IDocument document; if (!_visitor.TryGetDocument(x, out document)) { // Visit the symbol and try again x.Accept(_visitor); return(!_visitor.TryGetDocument(x, out document) ? null : document); } return(document); }) .Where(x => x != null) .ToImmutableArray(); _cached = true; } return(_values); }