Beispiel #1
0
        public void Update(IEnumerable <int> Changelists, TextWriter Log)
        {
            int MinChangelist = Changelists.Min();
            int MaxChangelist = Changelists.Max();

            Builds = new Dictionary <int, List <BuildUserMetadata> >();
            foreach (DirectoryInfo BaseDirectory in EnumerateMetadataDirectories(RootFolder, MinChangelist, MaxChangelist))
            {
                foreach (FileInfo FileInfo in BaseDirectory.EnumerateFiles("*.txt"))
                {
                    int Changelist;
                    if (ParseChangelistFromFileName(FileInfo.Name, out Changelist) && Changelist >= MinChangelist && Changelist <= MaxChangelist)
                    {
                        BuildUserMetadata Metadata;
                        if (CacheMetadata(FileInfo, out Metadata, Log))
                        {
                            List <BuildUserMetadata> UserMetadataList;
                            if (!Builds.TryGetValue(Changelist, out UserMetadataList))
                            {
                                UserMetadataList = new List <BuildUserMetadata>();
                                Builds.Add(Changelist, UserMetadataList);
                            }
                            UserMetadataList.Add(Metadata);
                        }
                    }
                }
            }
        }
Beispiel #2
0
 public void AddFilesToIgnore(string[] filesToAdd, SearchOption searchOption = SearchOption.AllDirectories)
 {
     Array.ForEach(filesToAdd, a => ItemsToIgnore.AddRange(BaseDirectory.EnumerateFiles(a, searchOption)));
 }
Beispiel #3
0
 public virtual FileInfo GetFile(string fileName)
 {
     return(BaseDirectory.EnumerateFiles(fileName, SearchOption).First());
 }