Пример #1
0
        public IEnumerable <VersionInfo> AllVersions(T o)
        {
            var versionBasePath         = new VersionBasePath(o);
            List <VersionInfo> versions = new List <VersionInfo>();

            if (versionBasePath.Exists())
            {
                var dirInfo = new DirectoryInfo(versionBasePath.PhysicalPath);
                foreach (var versionItem in dirInfo.EnumerateDirectories())
                {
                    int version = 0;
                    if (int.TryParse(versionItem.Name, out version))
                    {
                        var data = GetVersion(o, version);
                        if (data != null)
                        {
                            versions.Add(new VersionInfo()
                            {
                                Version = version, Date = versionItem.CreationTimeUtc, UserName = data.UserName
                            });
                        }
                    }
                }
            }
            return(versions.OrderByDescending(it => it.Version));
        }
Пример #2
0
        public VersionPath(DirectoryResource dir, int version)
        {
            var versionBasePath = new VersionBasePath(dir);

            this.PhysicalPath = Path.Combine(versionBasePath.PhysicalPath, version.ToString());
        }
Пример #3
0
 public VersionPath(DirectoryResource dir, int version)
 {
     var versionBasePath = new VersionBasePath(dir);
     this.PhysicalPath = Path.Combine(versionBasePath.PhysicalPath, version.ToString());
 }