private void FetchSnapshots() { string b = (m_snapshotPaths.Count <= 0) ? null : m_snapshotPaths[m_currentSnapshot]; m_currentSnapshot = 0; m_snapshotPaths.Clear(); SnapshotTool tool = ToolsModifierControl.GetTool <SnapshotTool>(); if (tool != null) { string snapShotPath = tool.snapShotPath; if (snapShotPath != null) { FileInfo[] fileInfo = SaveHelper.GetFileInfo(snapShotPath); if (fileInfo != null) { FileInfo[] array = fileInfo; for (int i = 0; i < array.Length; i++) { FileInfo fileInfo2 = array[i]; if (string.Compare(Path.GetExtension(fileInfo2.Name), ".png", StringComparison.OrdinalIgnoreCase) == 0) { if (Path.GetFileName(fileInfo2.Name).Contains("snapshot")) { m_snapshotPaths.Add(fileInfo2.FullName); if (fileInfo2.FullName == b) { m_currentSnapshot = m_snapshotPaths.Count - 1; } } } } } UIComponent prevButton = Find("Previous"); bool isEnabled = m_snapshotPaths.Count > 1; Find("Next").isEnabled = isEnabled; prevButton.isEnabled = isEnabled; RefreshSnapshot(); } } }