public LogCollector(MyQueue <string> paths, MyQueue <EventItem> events)
        {
            /*
             *    LogCollectorConfig config = LogCollectorConfig.GetSection(ConfigurationUserLevel.None);
             *    Console.WriteLine(config.ExampleAttribute);
             *    config.ExampleAttribute = "B";
             *    config.Class1.Add(new Class1Element());
             *    config.Save();
             */
            workers = new IWorkingElement[1 + NUM_READERS + NUM_PROCESSORS];
            int p = 0;

            workers[p] = new DirectoryScanner("Scanner", paths, inFiles);
            p++;
            for (int i = 0; i < NUM_READERS; i++)
            {
                workers[p] = new FileReader("FR-" + i, inFiles, rows, outFiles);
                p++;
            }
            for (int i = 0; i < NUM_PROCESSORS; i++)
            {
                workers[p] = new RowProcessor("RP-" + i, rows, events);
                p++;
            }
        }
Example #2
0
        public void FlatDirectoryToAudioBook()
        {
            DirectoryScanner scanner    = new DirectoryScanner();
            List <AudioBook> audioBooks = scanner.ScanForBooks(ScanDirectory);

            Assert.Equal(2, audioBooks.Count);
            Assert.Contains(audioBooks, book => book.Files.Count == 2);
            Assert.Contains(audioBooks, book => book.Files.Count == 3);
            AudioBook aFrequency  = audioBooks.Find(x => x.Files.Count == 2);
            AudioBook lifeOfNoise = audioBooks.Find(x => x.Files.Count == 3);

            Assert.Equal(1, aFrequency.Files[0].TrackNumber);
            Assert.Equal("1 minute A", aFrequency.Files[0].Name);
            Assert.Equal(2, aFrequency.Files[1].TrackNumber);
            Assert.Equal("30 minute A", aFrequency.Files[1].Name);


            Assert.Equal(1, lifeOfNoise.Files[0].TrackNumber);
            Assert.Equal("Pink", lifeOfNoise.Files[0].Name);

            Assert.Equal(2, lifeOfNoise.Files[1].TrackNumber);
            Assert.Equal("Brown", lifeOfNoise.Files[1].Name);

            Assert.Equal(3, lifeOfNoise.Files[2].TrackNumber);
            Assert.Equal("White", lifeOfNoise.Files[2].Name);
        }
Example #3
0
        static Migrations GetFromDirectory(string directory)
        {
            var scanner    = new DirectoryScanner(directory);
            var migrations = scanner.GetMigrations();

            return(new Migrations(migrations));
        }
Example #4
0
        /// <summary>
        /// Expands wildcards
        /// </summary>
        /// <param name="inList">The in list.</param>
        /// <returns>The expand list</returns>
        private ArrayList ExpandFileWildcards(ArrayList inList)
        {
            ArrayList outList = new ArrayList();

            foreach (string filespec in inList)
            {
                if (!string.IsNullOrEmpty(filespec))
                {
                    if (filespec.IndexOfAny(new char[] { '*', '?' }) > -1)
                    {
                        DirectoryScanner scanner = new DirectoryScanner();
                        scanner.Includes.Add(filespec);
                        // if GPL licensing permitted the NAnt DirectoryScanner to be used, there could
                        // be more bells and whistles available like recursive wildcards and excludes
                        //scanner.Excludes.Add("modules\\*\\**");
                        //scanner.BaseDirectory = new DirectoryInfo("test");
                        foreach (string filename in scanner.FileNames)
                        {
                            outList.Add(filename);
                        }
                    }
                    else
                    {
                        outList.Add(filespec);
                    }
                }
                else
                {
                    outList.Add(filespec);
                }
            }

            return(outList);
        }
Example #5
0
        public MainApp()
        {
            Configuration = new Configuration
            {
                Units = new List <ScannerUnit>
                {
                    new ScannerUnit
                    {
                        DirectoryForScan     = @"C:\",
                        DirectoryForTransfer = @"C:\Users\",
                        SearchPattern        = "*.extension"
                    }
                }
            };

            Settings = new SettingsConfig();

            if (File.Exists(SettingsPath))
            {
                Settings = SettingsConfig.GetSettings(SettingsPath);
            }

            if (File.Exists(ConfigPath))
            {
                Configuration = Configuration.GetConfiguration(ConfigPath);
            }

            SettingsConfig.SaveSettings(Settings, SettingsPath);
            Configuration.SaveConfiguration(Configuration, ConfigPath);

            MainExtensions.SetIsRunWhenStartValue(Settings.IsRunWhenComputerStarts);

            _scanner = new DirectoryScanner();
        }
        public override bool Execute()
        {
            try
            {
                var stopwatch = Stopwatch.StartNew();
                var fileCount = 0;

                using (var writer = new DependencyWriter(Output))
                {
                    foreach (var taskItem in Paths)
                    {
                        Log.LogMessage("Scanning '{0}' for dependencies", taskItem);

                        var scanner = new DirectoryScanner(ClosureBasePath, taskItem.ItemSpec);

                        var dependencies = scanner.GetSourceFiles();

                        fileCount += dependencies.Count;

                        Log.LogMessage("Found '{0}' source files with dependencies", dependencies.Count);

                        writer.WriteDependencies(dependencies);
                    }
                }

                Log.LogMessage("Wrote '{0}' dependencies to '{1}' in '{2}' ms", fileCount, Output, stopwatch.ElapsedMilliseconds);

                return true;
            }
            catch (Exception e)
            {
                Log.LogErrorFromException(e);
                return false;
            }
        }
Example #7
0
        /// <summary>Invoke the Hadoop record compiler on each record definition file</summary>
        /// <exception cref="Org.Apache.Tools.Ant.BuildException"/>
        public override void Execute()
        {
            if (src == null && filesets.Count == 0)
            {
                throw new BuildException("There must be a file attribute or a fileset child element"
                                         );
            }
            if (src != null)
            {
                DoCompile(src);
            }
            Project myProject = GetProject();

            for (int i = 0; i < filesets.Count; i++)
            {
                FileSet          fs   = filesets[i];
                DirectoryScanner ds   = fs.GetDirectoryScanner(myProject);
                FilePath         dir  = fs.GetDir(myProject);
                string[]         srcs = ds.GetIncludedFiles();
                for (int j = 0; j < srcs.Length; j++)
                {
                    DoCompile(new FilePath(dir, srcs[j]));
                }
            }
        }
Example #8
0
        public async Task <ActionResult> Update()
        {
            DirectoryScanner directoryScanner = new DirectoryScanner();
            BookInfoScanner  infoScanner      = new BookInfoScanner();

            foreach (MediaDirectory dir in _context.MediaDirectories.ToList())
            {
                List <AudioBook> scannedBooks = directoryScanner.ScanForBooks(dir.DirectoryPath);
                foreach (AudioBook scannedBook in scannedBooks)
                {
                    if (_context.AudioBooks.Any(x => x.AudioBookDirectoryPath == scannedBook.AudioBookDirectoryPath))
                    {
                        continue;
                    }
                    //todo: info scanning

                    EntityEntry <AudioBook> bookEntry = _context.AudioBooks.Add(scannedBook);
                    var entitesCreated = await _context.SaveChangesAsync();

                    //todo: log entries created
                }
            }

            return(Ok());
        }
Example #9
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            var infoTextWriter = new LambdaTextWriter(WriteVerbose);

            List <ChangeScript> allChangeScripts = new DirectoryScanner(infoTextWriter, Encoding.UTF8)
                                                   .GetChangeScriptsForDirectory(new DirectoryInfo(this.deltasDirectory));

            var repository    = new ChangeScriptRepository(allChangeScripts);
            var changeScripts = repository.GetAvailableChangeScripts();

            DbmsFactory factory       = new DbmsFactory(this.DatabaseType, this.ConnectionString);
            var         queryExecuter = new QueryExecuter(factory);

            var schemaManager = new DatabaseSchemaVersionManager(queryExecuter, factory.CreateDbmsSyntax(), this.TableName, true);

            var appliedChanges          = schemaManager.GetAppliedChanges();
            var notAppliedChangeScripts = changeScripts.Where(c => appliedChanges.All(a => a.ScriptNumber != c.ScriptNumber));

            var descriptionPrettyPrinter = new DescriptionPrettyPrinter();

            var objects = notAppliedChangeScripts
                          .Select(script => new
            {
                Id          = script.ScriptNumber,
                Description = descriptionPrettyPrinter.Format(script.ScriptName),
                File        = script.FileInfo
            });

            this.WriteObject(objects, true);
        }
Example #10
0
        private void patchWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            PreparePatchFile();
            DirectoryScanner scanner = new DirectoryScanner();

            if (string.IsNullOrEmpty(txtExtensions.Text))
            {
                scanner.SearchPattern = "*.*;";
            }
            else
            {
                scanner.SearchPattern = txtExtensions.Text;
            }
            scanner.FileEvent += new DirectoryScanner.FileEventHandler(patch_FileEvent);
            scanner.WalkDirectory(Application.StartupPath);

            foreach (XmlNode node in referenceFile.DocumentElement.ChildNodes)
            {
                string filePath = node.Attributes[0].Value;
                if (!File.Exists(filePath))
                {
                    string relativePath = filePath.Replace(Application.StartupPath, "").Trim('\\');
                    Invoke(new StringHandlerDelegate(AddDelFile), relativePath);
                }
            }
        }
Example #11
0
        public void ScansBooksBasic()
        {
            var books = DirectoryScanner.ScanDirectory(rootPath).ToArray();

            Assert.AreEqual(3, books.Length);
            Assert.IsTrue(books.Any(x => x.Name == "A1" && x.Files.Count == 2));
        }
Example #12
0
        public void Test_BaseDir_CaseSensitive()
        {
            if (!PlatformHelper.IsUnix)
            {
                return;
            }

            TempFile.Create(Path.Combine(_folder3, "filea.txt"));
            TempFile.Create(Path.Combine(_folder3, "fileb.tlb"));

            _scanner.Includes.Add("folder2/folder3/*.txt");
            _scanner.Scan();
            Assert.AreEqual(1, _scanner.FileNames.Count, "#1");

            _scanner.Includes.Add("Folder2/**/folder3/*.tlb");
            _scanner.Scan();
            Assert.AreEqual(1, _scanner.FileNames.Count, "#2");

            _scanner = new DirectoryScanner();
            _scanner.BaseDirectory = TempDirectory;
            _scanner.Includes.Add("**/*.tlb");
            _scanner.Scan();
            Assert.AreEqual(1, _scanner.FileNames.Count, "#3");

            _scanner.Excludes.Add("folder2/folder3/*.txt");
            _scanner.Excludes.Add("Folder2/**/folder3/*.tlb");
            _scanner.Scan();
            Assert.AreEqual(1, _scanner.FileNames.Count, "#4");
        }
Example #13
0
        public static List <String> GetDirectoryList(String path, Func <String, Boolean> filter, bool recursive = true)
        {
            var ret = new List <String>();
            var fs  = new DirectoryScanner(ret, filter, recursive);

            WalkTree(path, fs);
            return(ret);
        }
Example #14
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, HonyomiContext dbContext,
                              UserManager <IdentityUser> uMan)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                //delete db for debugging

                if (File.Exists(RuntimeConstants.DatabaseLocation))
                {
                    File.Delete(RuntimeConstants.DatabaseLocation);
                }
            }

            /***MVC***/
            app.UseMvc();

            /***Authentication  ***/
            app.UseAuthentication();

            /***Configure static files at root address "ui" instead of "wwwroot/dist" ***/
            app.UseStaticFiles(new StaticFileOptions()
            {
                FileProvider =
                    new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(),
                                                          "wwwroot"))
            });

            /***Add Hangfire for Background tasks***/
            app.UseHangfireDashboard();
            app.UseHangfireServer();

            /***Create DB and populate defaults if needed***/
            if (dbContext.Database.EnsureCreated())
            {
                dbContext.CreateDefaults(uMan);
            }

            HonyomiConfig config = dbContext.Configs.First();

            port = config.ServerPort;
            //debug scan path
            if (env.IsDevelopment())
            {
                dbContext.WatchDirectories.Add(new WatchDirectory()
                {
                    ConfigId = config.HonyomiConfigId,
                    Path     = Path.Combine(Directory.GetCurrentDirectory(),
                                            "..", "HonYomi.Tests",
                                            "scanTestDir")
                });
                dbContext.SaveChanges();
            }

            DirectoryScanner.ScanWatchDirectories();
            RecurringJob.AddOrUpdate("scan", () => DirectoryScanner.ScanWatchDirectories(),
                                     Cron.MinuteInterval(config.ScanInterval));
        }
Example #15
0
        private void firstRunPatchWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            PreparePatchFile();
            DirectoryScanner scanner = new DirectoryScanner();

            scanner.SearchPattern = "*.*;";
            scanner.FileEvent    += new DirectoryScanner.FileEventHandler(firstRun_FileEvent);
            scanner.WalkDirectory(Application.StartupPath);
        }
Example #16
0
 static void Main(string[] args)
 {
     if (Environment.UserInteractive)
     {
         DirectoryScanner ds = new DirectoryScanner(args);
         Console.Write("Service is running");
         Console.ReadLine();
     }
 }
Example #17
0
        private void ScannerMenuItem_Click(object sender, EventArgs e)
        {
            var dialog = new FolderBrowserDialog();

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                var scanner = new DirectoryScanner();
                List <DumpEntity> result = scanner.ScanDirectory(dialog.SelectedPath);
            }
        }
Example #18
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LocalSongFinder"/> class.
        /// </summary>
        /// <param name="path">The path of the directory where the recursive search should start.</param>
        public LocalSongFinder(string path)
        {
            this.tagLock      = new object();
            this.songListLock = new object();

            this.pathQueue          = new Queue <string>();
            this.corruptFiles       = new List <string>();
            this.scanner            = new DirectoryScanner(path);
            this.scanner.FileFound += ScannerFileFound;
        }
Example #19
0
        private static IEnumerable <FileSystemEntryComparison> Scan()
        {
            var scanner    = new DirectoryScanner(ScanOptions.DirectoryToScan);
            var scanResult = scanner.Scan();

            var referenceFileContents = new JsonReferenceFileReader().Read(ScanOptions.ReferenceFile);

            var comparison = referenceFileContents.FirstOrDefault().CompareTo(scanResult.FirstOrDefault());

            return(comparison);
        }
Example #20
0
    private void Scan()
    {
        var configReader = new YamlConfigReader(configPath);
        var localPath    = configReader.ReadPath() ?? path;


        var directoryScanner = new DirectoryScanner(localPath);
        var explorerItems    = directoryScanner.Scan();

        var imageFileNames = explorerItems.Select(p => p.ImageFileName).ToList();

        if (imageFileNamesSnapshot != null && imageFileNames.SequenceEqual(imageFileNamesSnapshot))
        {
            return;
        }
        imageFileNamesSnapshot = imageFileNames;
        Debug.Log("changed");

        var objects = transform.GetComponentsInChildren <Transform>().Where(p => p != transform);

        foreach (var obj in objects)
        {
            Object.Destroy(obj.gameObject);
        }

        foreach (var explorerItem in explorerItems)
        {
            var bytes   = File.ReadAllBytes(explorerItem.ImageFileName);
            var texture = new Texture2D(2, 2);
            texture.LoadImage(bytes);
            var rect   = new Rect(0F, 0F, texture.width, texture.height);
            var border = new Vector4(0F, 0F, texture.width, texture.height);
            var sprite = Sprite.Create(texture, rect, Vector3.zero, 100F, 0, SpriteMeshType.FullRect, border);
            var panel  = new GameObject("Cell").AddComponent <RectTransform>();
            panel.SetParent(transform);
            var image = new GameObject("Picture").AddComponent <Image>();
            image.transform.SetParent(panel);
            image.sprite         = sprite;
            image.preserveAspect = true;

            var text = new GameObject("Name").AddComponent <Text>();
            text.transform.SetParent(panel);
            text.font      = Resources.GetBuiltinResource <Font>("Arial.ttf");
            text.fontSize  = 22;
            text.color     = Color.black;
            text.text      = explorerItem.Name;
            text.alignment = TextAnchor.UpperCenter;
            var textRectTransform = text.GetComponent <RectTransform>();
            textRectTransform.anchorMin        = new Vector2(0.1F, 0.1F);
            textRectTransform.anchorMax        = new Vector2(0.9F, 0.9F);
            textRectTransform.anchoredPosition = Vector2.zero;
            textRectTransform.sizeDelta        = Vector2.zero;
        }
    }
        public void Should_sort_file_when_found_a_file_in_sub_directory()
        {
            IFileScanner fileScanner = Substitute.For<IFileScanner>();

            var directoryScanner = new DirectoryScanner(fileScanner);

            directoryScanner.Scan(@"DirectoryScanner\");

            fileScanner.Received(1).Sort(
                Arg.Is<string>(s => s.EndsWith(@"DirectoryScanner\SubDirectory\Test.txt")));
        }
Example #22
0
        public void ProcessSourceDirectory()
        {
            StaticLogger.Log("Scaning directory for changes.");
            var scanner = new DirectoryScanner(_sourceDirectory, _targetDirectory);
            var files   = scanner.GetFilesToCopy();

            StaticLogger.Log($"Found {files.Count} new files.");
            foreach (var file in files)
            {
                CopyFile(file);
            }
        }
Example #23
0
        public void ProcessDirectory(IDirectoryObject directory)
        {
            var targetDirectory = GetTargetDirectory(directory.FullName);

            var scanner = new DirectoryScanner(directory, targetDirectory);
            var files   = scanner.GetFilesToCopy();

            foreach (var file in files)
            {
                CopyFile(file);
            }
        }
Example #24
0
 public IActionResult ScanNow()
 {
     try
     {
         DirectoryScanner.ScanWatchDirectories();
         return(Json(true));
     }
     catch (Exception)
     {
         return(BadRequest());
     }
 }
        public void CreateJsonReferenceFile_should_create_file_on_disk()
        {
            var scanner = new DirectoryScanner(@"C:\temp");
            var referenceFileOutputPath = @"C:\temp\dirref.json";

            new JsonReferenceFileCreator(scanner, Formatting.Indented).CreateReferenceFile(referenceFileOutputPath);
            Assert.IsTrue(File.Exists(referenceFileOutputPath));

            var actual = referenceFileOutputPath.Deserialize();

            Assert.IsTrue(actual.Any());
        }
Example #26
0
		public FileSet()
		{
			baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
			directoryScannerForIncludes = new DirectoryScanner();
			directoryScannerForExcludes = new DirectoryScanner();
			pathScannerForIncludes = new PathScanner();
			pathScannerForExcludes = new PathScanner();
			includeSearchPatternsForRemoval = new List<string>();
			excludeSearchPatternsForRemoval = new List<string>();
			AllDirectories = new List<FileSetDirectory>();
			AllFiles = new List<FileSetFile>();
			SearchPatterns = new List<SearchPattern>();
		}
Example #27
0
        public void ScansBooksBasicAndInserts()
        {
            var books = DirectoryScanner.ScanDirectory(rootPath).ToArray();

            HonyomiContext.DeleteDatabase();
            using (var db = new HonyomiContext())
            {
                db.Database.EnsureCreated();
                DataAccess.InsertNewBooks(books);
                Assert.AreEqual(3, db.Books.Count());
                Assert.IsTrue(db.Books.Include(x => x.Files).Any(x => x.Title == "A1" && x.Files.Count == 2));
            }
        }
Example #28
0
        public void DirScanerTest()
        {
            DirectoryScanner dscan = new DirectoryScanner(false);

            dscan.BaseDirectory = new DirectoryInfo("c:\\devel");

            dscan.Includes.Add("**/tools/*");

            dscan.Scan();

            StringCollection dirs  = dscan.DirectoryNames;
            StringCollection files = dscan.FileNames;
        }
Example #29
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            DirectoryScanner scanner  = CreateScanner();
            MainForm         mainForm = CreateMainForm(scanner);

            CreateXMLWriter(mainForm, scanner);
            // this one for deep tree in XML
            CreateTreeXMLWriter(mainForm, scanner);

            Application.Run(mainForm);
        }
Example #30
0
 private void SetupGridRegex(DirectoryScanner di)
 {
     dataGridView1.Columns.Add("status", "status");
     dataGridView1.Columns.Add("scenario", "scenario");
     dataGridView1.Columns.Add("siteid", "siteid");
     dataGridView1.Columns.Add("filename", "filename");
     dataGridView1.Columns["filename"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
     for (int i = 0; i < di.Files.Length; i++)
     {
         dataGridView1.Rows.Add(new object[] { "", di.Scenario[i],
                                               di.Siteid[i],
                                               di.Files[i] });
     }
 }
Example #31
0
        protected override void SetUp()
        {
            base.SetUp();

            _folder1 = Path.Combine(TempDirName, "folder1");
            _folder2 = Path.Combine(TempDirName, "folder2");
            _folder3 = Path.Combine(_folder2, "folder3");
            Directory.CreateDirectory(_folder1);
            Directory.CreateDirectory(_folder2);
            Directory.CreateDirectory(_folder3);

            _scanner = new DirectoryScanner();
            _scanner.BaseDirectory = TempDirectory;
        }
        public void DoDeploy(Int64 lastChangeToApply)
        {
            Console.Out.WriteLine("dbdeploy v2.12");

            List <ChangeScript>    changeScripts  = new DirectoryScanner().GetChangeScriptsForDirectory(dir);
            ChangeScriptRepository repository     = new ChangeScriptRepository(changeScripts);
            List <Int64>           appliedChanges = schemaManager.GetAppliedChangeNumbers();

            GenerateChangeScripts(repository, lastChangeToApply, appliedChanges);
            if (undoOutputPrintStream != null)
            {
                GenerateUndoChangeScripts(repository, lastChangeToApply, appliedChanges);
            }
        }
Example #33
0
        private void buttonApplyFilter_Click(object sender, EventArgs e)
        {
            if (!Directory.Exists(SelectedPath))
                return;

            DirectoryScanner di = new DirectoryScanner(SelectedPath, this.textBoxFilter.Text, this.comboBoxRegex.Text);
            this.dataGridView1.Columns.Clear();
            if (this.comboBoxRegex.Text.Trim() == "")
                SetupGridBasic(di.Files);
            else
                SetupGridRegex(di);
            if (di.Files.Length > 0)
                buttonImport.Enabled = true;
        }
Example #34
0
 private void ScanDestination()
 {
     DirectoryScanner scanTron = new DirectoryScanner(Destination);
     foreach (FileInfo file in scanTron)
     {
         FileInfo matchingSourceFile = new FileInfo(Helpers.TransformPath(Destination, Source, file.FullName));
         if (!matchingSourceFile.Exists)
         {
             DeleteOperation delete = new DeleteOperation(file.FullName);
             delete.DeleteEmptyFolder = true;
             manager.AddOperation(delete);
         }
     }
 }
Example #35
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LocalSongFinder"/> class.
        /// </summary>
        /// <param name="path">The path of the directory where the recursive search should start.</param>
        public LocalSongFinder(string path)
        {
            if (path == null)
            {
                Throw.ArgumentNullException(() => path);
            }

            this.tagLock      = new object();
            this.songListLock = new object();

            this.pathQueue          = new Queue <string>();
            this.corruptFiles       = new List <string>();
            this.scanner            = new DirectoryScanner(path);
            this.scanner.FileFound += ScannerFileFound;
        }
Example #36
0
        private void ScanSource()
        {
            DirectoryScanner scanTron = new DirectoryScanner(Source);
            foreach (FileInfo file in scanTron)
            {
                FileInfo destination = new FileInfo(Helpers.TransformPath(Source, Destination, file.FullName));

                if (destination.Exists && (destination.LastWriteTime >= file.LastWriteTime))
                    continue;

                CopyOperation copy = new CopyOperation(file.FullName, destination.FullName);

                copy.Overwrite = true;
                copy.CreateFolder = true;

                manager.AddOperation(copy);
            }
        }
Example #37
0
		private void UpdateAfterScan(DirectoryScanner directoryScanner, PathScanner pathScanner, bool isForExclude = false)
		{
			foreach (var item in directoryScanner.DirectoryNames)
			{
				if (Directory.Exists(item))
					AllDirectories.Add(
						new FileSetDirectory
						{
							IsIncluded = !isForExclude,
							IsExcluded = isForExclude,
							DirectoryFullName = item
						});
				else
					AllFiles.Add(
						new FileSetFile
						{
							IsIncluded = !isForExclude,
							IsExcluded = isForExclude,
							FileFullName = item
						});
			}

			foreach (var item in directoryScanner.FileNames)
				AllFiles.Add(
					new FileSetFile
					{
						IsIncluded = !isForExclude,
						IsExcluded = isForExclude,
						FileFullName = item
					});

			foreach (var item in pathScanner.Scan())
				AllFiles.Add(
					new FileSetFile
					{
						IsIncluded = !isForExclude,
						IsExcluded = isForExclude,
						FileFullName = item
					});
		}
Example #38
0
 private void SetupGridRegex(DirectoryScanner di )
 {
     dataGridView1.Columns.Add("status", "status");
     dataGridView1.Columns.Add("scenario", "scenario");
     dataGridView1.Columns.Add("siteid", "siteid");
     dataGridView1.Columns.Add("filename", "filename");
     dataGridView1.Columns["filename"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
     for (int i = 0; i < di.Files.Length; i++)
     {
       dataGridView1.Rows.Add(new object[] { "",di.Scenario[i],
                                              di.Siteid[i],
                                              di.Files[i] });
     }
 }