public RawDataFile GetRawFile(string name) { AbstractDataFile cached; if (_cache.TryGetValue(name, out cached)) return (RawDataFile)cached; var result = new RawDataFile(_carDirectory, name, _acd); _cache[name] = result; return result; }
public RawDataFile GetRawFile(string name) { lock (_cache) { AbstractDataFile cached; if (_cache.TryGetValue(name, out cached) && cached is RawDataFile) { return((RawDataFile)cached); } var result = new RawDataFile(_carDirectory, name, _acd); _cache[name] = result; return(result); } }