public IEnumerable<int> AllVersions(TextContent content) { ContentVersionPath versionPath = new ContentVersionPath(content); if (Directory.Exists(versionPath.PhysicalPath)) { foreach (var file in Directory.EnumerateFiles(versionPath.PhysicalPath)) { string fileName = Path.GetFileNameWithoutExtension(file); int version; if (int.TryParse(fileName, out version)) { yield return version; } } } }
private string GetVersionFile(TextContent content, int version) { ContentVersionPath versionPath = new ContentVersionPath(content); return Path.Combine(versionPath.PhysicalPath, string.Format("{0}.xml", version)); }