// Token: 0x0600091D RID: 2333 RVA: 0x00041914 File Offset: 0x0003FB14 private void UpdateEntry(FolderMruCacheEntry newEntry, int oldEntryIndex) { FolderMruCacheEntry folderMruCacheEntry = this.cacheEntries[oldEntryIndex]; folderMruCacheEntry.UsageCount++; folderMruCacheEntry.UsedInCurrentSession = true; }
// Token: 0x0600092A RID: 2346 RVA: 0x00041F74 File Offset: 0x00040174 private void ParseRoot(XmlTextReader reader) { if (reader.NodeType == XmlNodeType.Element) { if (reader.IsEmptyElement) { this.ThrowParserException(reader); return; } if (string.CompareOrdinal("entry", reader.Name) != 0) { this.ThrowParserException(reader); return; } if (this.firstEmptyIndex != -1) { FolderMruCacheEntry folderMruCacheEntry = new FolderMruCacheEntry(); folderMruCacheEntry.ParseEntry(reader, this.userContext); this.cacheEntries[this.firstEmptyIndex] = folderMruCacheEntry; this.state = FolderMruCache.XmlParseState.Child; if (this.firstEmptyIndex < 19 && this.firstEmptyIndex != -1) { this.firstEmptyIndex++; this.cacheLength = this.firstEmptyIndex; return; } this.firstEmptyIndex = -1; this.cacheLength = 20; return; } } else { if (reader.NodeType == XmlNodeType.EndElement && string.CompareOrdinal("FolderMruCache", reader.Name) == 0) { this.state = FolderMruCache.XmlParseState.Finished; return; } this.ThrowParserException(reader); } }
// Token: 0x0600091C RID: 2332 RVA: 0x00041864 File Offset: 0x0003FA64 public void AddEntry(FolderMruCacheEntry newEntry) { if (newEntry == null) { throw new ArgumentNullException("newEntry"); } int entryIndexByFolderId = this.GetEntryIndexByFolderId(newEntry.FolderId); int num; if (entryIndexByFolderId == -1) { if (this.firstEmptyIndex == -1) { num = this.GetLeastUsageEntryIndex(); } else { num = this.firstEmptyIndex; } newEntry.SetInitialUsage(); this.cacheEntries[num] = newEntry; if (this.firstEmptyIndex != -1 && this.firstEmptyIndex < 19) { this.firstEmptyIndex++; this.cacheLength = this.firstEmptyIndex; } else { this.firstEmptyIndex = -1; this.cacheLength = 20; } } else { num = entryIndexByFolderId; this.UpdateEntry(newEntry, num); } this.cacheEntries[num].UpdateTimeStamp(); }
// Token: 0x06000919 RID: 2329 RVA: 0x000417C8 File Offset: 0x0003F9C8 int IComparer.Compare(object x, object y) { FolderMruCacheEntry folderMruCacheEntry = x as FolderMruCacheEntry; FolderMruCacheEntry folderMruCacheEntry2 = y as FolderMruCacheEntry; if (folderMruCacheEntry == null && folderMruCacheEntry2 == null) { return(0); } if (folderMruCacheEntry == null) { return(1); } if (folderMruCacheEntry2 == null) { return(-1); } if (folderMruCacheEntry2.UsageCount != folderMruCacheEntry.UsageCount) { return(folderMruCacheEntry2.UsageCount.CompareTo(folderMruCacheEntry.UsageCount)); } return(folderMruCacheEntry2.LastAccessedDateTimeTicks.CompareTo(folderMruCacheEntry.LastAccessedDateTimeTicks)); }
// Token: 0x06000921 RID: 2337 RVA: 0x00041A38 File Offset: 0x0003FC38 private void InternalFinishCacheSession() { int num = -1; int i = 0; while (i < this.cacheLength) { FolderMruCacheEntry folderMruCacheEntry = this.cacheEntries[i]; if (!folderMruCacheEntry.UsedInCurrentSession) { folderMruCacheEntry.NumberOfSessionsSinceLastUse++; } else { folderMruCacheEntry.NumberOfSessionsSinceLastUse = 0; } int numberOfSessionsSinceLastUse = folderMruCacheEntry.NumberOfSessionsSinceLastUse; if (numberOfSessionsSinceLastUse <= 12) { if (numberOfSessionsSinceLastUse <= 6) { if (numberOfSessionsSinceLastUse != 3 && numberOfSessionsSinceLastUse != 6) { goto IL_E9; } } else if (numberOfSessionsSinceLastUse != 9) { if (numberOfSessionsSinceLastUse != 12) { goto IL_E9; } num = FolderMruCache.ComputeDecay(0.25, 2, folderMruCacheEntry.UsageCount); goto IL_FA; } num = 1; } else if (numberOfSessionsSinceLastUse <= 23) { if (numberOfSessionsSinceLastUse != 17) { if (numberOfSessionsSinceLastUse != 23) { goto IL_E9; } num = FolderMruCache.ComputeDecay(0.5, 4, folderMruCacheEntry.UsageCount); } else { num = FolderMruCache.ComputeDecay(0.25, 3, folderMruCacheEntry.UsageCount); } } else if (numberOfSessionsSinceLastUse != 26) { if (numberOfSessionsSinceLastUse != 31) { goto IL_E9; } num = 0; folderMruCacheEntry.UsageCount = 0; } else { num = FolderMruCache.ComputeDecay(0.75, 5, folderMruCacheEntry.UsageCount); } IL_FA: if (num > 0) { folderMruCacheEntry.DecayUsage(num); } i++; continue; IL_E9: if (folderMruCacheEntry.NumberOfSessionsSinceLastUse > 31) { folderMruCacheEntry.UsageCount = 0; goto IL_FA; } goto IL_FA; } }