public ImageContainer GetExistingContainer(FileListEntry key) { lock (this.cache) { this.cache.TryGetValue(key, out ImageContainer container); return(container); } }
private bool TryGetFile(int index, out FileListEntry file) { if (this.currentFileList == null || index < 0 || index >= this.currentFileList.Count) { file = null; return(false); } file = this.currentFileList[index]; return(true); }
public ImageContainer GetOrCreateContainer(FileListEntry key) { lock (this.cache) { if (!this.cache.TryGetValue(key, out ImageContainer container)) { container = new ImageContainer(this, key); this.cache.Add(key, container); } return(container); } }
private CacheWorkItem GetCacheWorkItemForCurrentDisplayIndex() { var items = new FileListEntry[fileLoadOrder.Length]; var list = this.currentFileList; for (int i = 0; i < items.Length; ++i) { int offset = fileLoadOrder[i]; int index = this.currentDisplayIndex + offset; int tmp_wrapped_around = index % list.Count; if (tmp_wrapped_around < 0) { tmp_wrapped_around += list.Count; } items[i] = list[tmp_wrapped_around]; } return(new CacheWorkItem(items[0], items)); }
public OverviewFileListEntry(FileListEntry fileListEntry) { Debug.Assert(fileListEntry != null); this.fileListEntry = fileListEntry; this.fileName = Path.GetFileName(this.fileListEntry.FullPath); }
internal ImageContainer(ImageCache owner, FileListEntry key) { this.Key = key ?? throw new ArgumentNullException(nameof(key)); this.owner = owner ?? throw new ArgumentNullException(nameof(owner)); }
public ImageContainer GetOrCreateContainer(FileListEntry key) { return(this.imageCache.GetOrCreateContainer(key)); }
public CacheWorkItem(FileListEntry displayPath, FileListEntry[] surroundingPaths) { this.DisplayPath = displayPath; this.SurroundingPaths = surroundingPaths; }