Exemple #1
0
 private void AddNewFilesIn(string path)
 {
     if (Directory.Exists(path) && (File.GetAttributes(path) & FileAttributes.Hidden) == 0)
     {
         List <string> explored   = new List <string>();
         List <string> foundFiles = new List <string>();
         ExploreFolder(path, masks, explored, foundFiles);
         foreach (string fileName in foundFiles)
         {
             if (!files.ContainsKey(fileName.ToUpper()))
             {
                 //TraceManager.Add("add: " + fileName);
                 FileModel newModel = new FileModel(fileName);
                 newModel.Context   = Owner;
                 newModel.OutOfDate = true;
                 if (Owner.IsModelValid(newModel, this))
                 {
                     files[fileName.ToUpper()] = newModel;
                 }
             }
         }
     }
 }