private string GetSessionFileName(GarminSessionHeader sessionHeader) { return Path.Combine(CacheDirectory, sessionHeader.Key + ".bin"); }
public GarminSession GetSessionFromCache(GarminSessionHeader sessionHeader) { if (!cachedSessionHeaders.ContainsKey(sessionHeader.Key)) return null; try { return CommonUtil.DeserializeFromFile<GarminSession>(GetSessionFileName(sessionHeader)); } catch (Exception) { return null; } }