示例#1
0
 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;
             }
         }
     }
 }
示例#2
0
        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);
                    }
                }
            }
        }
示例#3
0
 private string GetVersionFile(TextContent content, int version)
 {
     ContentVersionPath versionPath = new ContentVersionPath(content);
     return Path.Combine(versionPath.PhysicalPath, string.Format("{0}.xml", version));
 }
示例#4
0
        private string GetVersionFile(TextContent content, int version)
        {
            ContentVersionPath versionPath = new ContentVersionPath(content);

            return(Path.Combine(versionPath.PhysicalPath, string.Format("{0}.xml", version)));
        }