namespace IStation { internal sealed partial class SharedMemoryCache { /// /// Queries key in cache for object of type T /// /// type of object expected /// key to the cache item to get /// an object from cache of type T, else default(T) public T Get(string key) { return this.Get(key, out _); } /// /// Queries key in cache for object of type T /// /// type of object expected /// key to the cache item to get /// output parameter, indicates whether the return value was found in the cache and of the expected type /// an object from cache of type T, else default(T) public T Get(string key, out bool found) { object value = this.Get(key); if (value is T) { found = true; return (T)value; } found = false; return default(T); } /// /// Wrapper /// /// /// public object Get(string key) { return this._memoryCache[key]; } } }