Beispiel #1
0
 /// <summary>
 ///   Reads project versions from version file(s).
 /// </summary>
 /// <param name="projectReader">
 ///   Project reader used to read project file.
 /// </param>
 /// <returns>
 ///   Dictionary of versions read.
 /// </returns>
 private IDictionary<VersionType, VersionBase> GetVersions(ProjectReader projectReader)
 {
     Dictionary<VersionType, VersionBase> versions = new Dictionary<VersionType, VersionBase>();
     // read versions from version files
     foreach (string versionFile in versionFiles)
     {
         VersionFileReader vfr = VersionFileReaderFactory.CreateFileReader(versionFile);
         versions = versions.Concat(vfr.Versions).ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
     }
     return versions;
 }
Beispiel #2
0
 /// <summary>
 ///   Gets the last time of version file change.
 /// </summary>
 /// <param name="projectReader"></param>
 /// <returns></returns>
 private DateTime GetVersionFileChangeTime(ProjectReader projectReader)
 {
     return versionFiles.Max(filename => new FileInfo(filename).LastWriteTime);
 }
Beispiel #3
0
 /// <summary>
 ///   Gets all version files in the project.
 /// </summary>
 /// <param name="projectReader">
 ///   Project reader used to read project file.
 /// </param>
 /// <returns>
 ///   Collection of version file fullnames.
 /// </returns>
 private IEnumerable<string> GetVersionFiles(ProjectReader projectReader)
 {
     VersionFileSelector vfs = VersionFileSelectorFactory.CreateSelector(this);
     return vfs.GetVersionFiles(projectReader.FileFullNames);
 }
Beispiel #4
0
 /// <summary>
 ///   Gets the last time of any file change.
 /// </summary>
 /// <param name="projectReader">
 ///   Project reader used to read project file.
 /// </param>
 /// <returns>
 ///   Last <c>DateTime</c> when a file in project has been changed.
 /// </returns>
 private DateTime GetLastFileChangeTime(ProjectReader projectReader)
 {
     return projectReader.FileFullNames.Max(filename => new FileInfo(filename).LastWriteTime);
 }