当前位置: 首页>>代码示例>>C#>>正文


C# FileSystem.FindFiles方法代码示例

本文整理汇总了C#中FileSystem.FindFiles方法的典型用法代码示例。如果您正苦于以下问题:C# FileSystem.FindFiles方法的具体用法?C# FileSystem.FindFiles怎么用?C# FileSystem.FindFiles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FileSystem的用法示例。


在下文中一共展示了FileSystem.FindFiles方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RenameClasses

        public void RenameClasses()
        {
            var folder = ".".ToFullPath().ParentDirectory().ParentDirectory()
                .AppendPath("CodeTracker");

            var fileSystem = new FileSystem();
            var files = fileSystem.FindFiles(folder, FileSet.Shallow("*.json"));

            

            foreach (var file in files)
            {
                var json = fileSystem.ReadStringFromFile(file);

                json = replace(json, "GithubProject");
                json = replace(json, "Timestamped[]");
                json = replace(json, "ProjectStarted");
                json = replace(json, "IssueCreated");
                json = replace(json, "IssueClosed");
                json = replace(json, "IssueReopened");
                json = replace(json, "Commit");


                fileSystem.WriteStringToFile(file, json);
            }

        }
开发者ID:phillip-haydon,项目名称:marten,代码行数:27,代码来源:AsyncDaemonFixture.cs

示例2: LoadAllProjects

        public void LoadAllProjects()
        {
            var fileSystem = new FileSystem();

            var folder = AppContext.BaseDirectory;
            while (!folder.EndsWith("Marten.Testing"))
            {
                folder = folder.ParentDirectory();
            }

            folder = folder.AppendPath("CodeTracker");

            var files = fileSystem.FindFiles(folder, FileSet.Shallow("*.json"));

            AllProjects = new Dictionary<Guid, GithubProject>();
            foreach (var file in files)
            {
                var project = GithubProject.LoadFrom(file);
                AllProjects.Add(project.Id, project);

                Console.WriteLine($"Loaded {project.OrganizationName}{project.ProjectName} from JSON");
            }

            _store.Advanced.Clean.DeleteAllDocuments();
            PublishAllProjectEvents(_store);
        }
开发者ID:tim-cools,项目名称:Marten,代码行数:26,代码来源:AsyncDaemonFixture.cs

示例3: Main

        public static int Main(string[] args)
        {
            var fileSystem = new FileSystem();

            string srcDirectory = AppDomain.CurrentDomain.BaseDirectory.ParentDirectory().ParentDirectory().ParentDirectory().ParentDirectory();
            string buildDirectory = args.Any()
                                        ? args.Single()
                                        : srcDirectory.ParentDirectory().ParentDirectory().AppendPath("buildsupport");

            Console.WriteLine("Trying to copy to " + buildDirectory);
            if (!fileSystem.DirectoryExists(buildDirectory))
            {
                throw new ApplicationException("Could not find the buildsupport directory");
            }

            var targetDirectory = buildDirectory.AppendPath("FubuDocs");

            fileSystem.CreateDirectory(targetDirectory);
            fileSystem.CleanDirectory(targetDirectory);

            var fromDirectory = srcDirectory.AppendPath("FubuDocsRunner").AppendPath("bin").AppendPath("debug");
            var files = FileSet.Deep("*.dll;*.pdb;*.exe");
            fileSystem.FindFiles(fromDirectory, files).Each(file => {
                Console.WriteLine("Copying {0} to {1}", file, targetDirectory);
                fileSystem.Copy(file, targetDirectory, CopyBehavior.overwrite);
            });

            return 0;
        }
开发者ID:mtscout6,项目名称:FubuWorld,代码行数:29,代码来源:Program.cs

示例4: SetUp

 public void SetUp()
 {
     var system = new FileSystem();
     system.FindFiles(".".ToFullPath(), new FileSet
     {
         Include = "*.asset.config;*.script.config"
     }).ToList().Each(system.DeleteFile);
 }
开发者ID:kingreatwill,项目名称:fubumvc,代码行数:8,代码来源:FubuApplicationTester.cs

示例5: FindAssemblies

        public IEnumerable<string> FindAssemblies(string applicationDirectory)
        {
            var assemblyNames = new FileSet { Include = "*.dll", DeepSearch = false };
            var fileSystem = new FileSystem();

            return FubuMvcPackageFacility
                .GetPackageDirectories()
                .SelectMany(dir => fileSystem.FindFiles(dir, assemblyNames));
        }
开发者ID:jemacom,项目名称:fubumvc,代码行数:9,代码来源:StandaloneAssemblyPackageLoader.cs

示例6: ReadDirectory

 public void ReadDirectory(string directory)
 {
     Console.WriteLine("Searching directory {0} for samples", directory);
     var system = new FileSystem();
     system.FindFiles(directory, new FileSet{
         DeepSearch = true,
         Include = "*.cs"
     })
         .Each(readFile);
 }
开发者ID:spascoe,项目名称:ripple,代码行数:10,代码来源:SampleReader.cs

示例7: not_part_of_the_by_type_dump

        public void not_part_of_the_by_type_dump()
        {
            var fileSystem = new FileSystem();
            fileSystem.CleanDirectory("sql");
            
            theStore.Schema.WriteDDLByType("sql");

            fileSystem.FindFiles("sql", FileSet.Shallow("*.sql"))
                .Any(x => x.EndsWith("mt_streams.sql"))
                .ShouldBeFalse();

            
        }
开发者ID:danielmarbach,项目名称:marten,代码行数:13,代码来源:Bug_443_erroneously_creating_the_event_tables_when_unnecessary.cs

示例8: cleans_up_the_orphaned_nupkg_files

        public void cleans_up_the_orphaned_nupkg_files()
        {
            RippleOperation
                .For<SolutionInput>(new SolutionInput(), theSolution)
                .Step<DownloadMissingNugets>()
                .Step<ExplodeDownloadedNugets>()
                .Step<FixReferences>()
                .Execute();

            var fileSystem = new FileSystem();
            var files = fileSystem.FindFiles(theSolution.PackagesDirectory(), new FileSet {DeepSearch = false, Include = "*.nupkg"});

            files.ShouldHaveCount(0);
        }
开发者ID:bobpace,项目名称:ripple,代码行数:14,代码来源:IntegratedRestoreWithError.cs

示例9: icontainer_facility_is_registered_during_construction_for_later

        public void icontainer_facility_is_registered_during_construction_for_later()
        {
            var system = new FileSystem();
            system.FindFiles(".".ToFullPath(), new FileSet{
                Include = "*.asset.config;*.script.config"
            }).ToList().Each(system.DeleteFile);

            var container = new Container();
            FubuApplication.For(new FubuRegistry()).StructureMap(container).Bootstrap();

            container.GetInstance<IContainerFacility>()
                .ShouldBeOfType<StructureMapContainerFacility>()
                .ShouldNotBeNull();
        }
开发者ID:roend83,项目名称:fubumvc,代码行数:14,代码来源:FubuApplicationTester.cs

示例10: readSpecs

        private IDictionary<string, EmbeddedSpec> readSpecs()
        {
            var dict = new Dictionary<string, EmbeddedSpec>();

            var fileSystem = new FileSystem();
            fileSystem.FindFiles(_settings.Root, FileSet.Deep("*.specs.json")).Each(file =>
            {
                var json = fileSystem.ReadStringFromFile(file);
                var response = JsonSerialization.Deserialize<BatchRunResponse>(json);
                var fixtures = new Dictionary<string, FixtureModel>();
                response.fixtures.Each(x => fixtures.Add(x.key, x));

                response.records.Each(rec => dict.Add(rec.specification.path, new EmbeddedSpec(fixtures, rec)));
            });

            return dict;
        }
开发者ID:storyteller,项目名称:Storyteller,代码行数:17,代码来源:EmbeddedSpecData.cs

示例11: findByName

        private ApplicationSettings findByName(FileSystem system)
        {
            var files = system.FindFiles(".".ToFullPath(), ApplicationSettings.FileSearch(Location));
            if (!files.Any())
            {
                Console.WriteLine("Could not find any matching *.application.config files");
                return null;
            }

            if (files.Count() == 1)
            {
                var location = files.Single();
                Console.WriteLine("Using file " + location);
                return ApplicationSettings.Read(location);
            }

            Console.WriteLine("Found multiple *.application.settings files");
            files.Each(x => Console.WriteLine(" - " + x));

            return null;
        }
开发者ID:wbinford,项目名称:fubu,代码行数:21,代码来源:AppInput.cs

示例12: regenerate_the_templates

        public void regenerate_the_templates()
        {
            var applicationPath =
                AppDomain.CurrentDomain.BaseDirectory
                .ParentDirectory().ParentDirectory()
                .AppendPath("FubuApp").ToFullPath();

            var templatePath = applicationPath.AppendPath("_templates");

            var files = new FileSystem();
            files.CleanDirectory(templatePath);

            var request = new ApplicationRequest
            {
                TemplatesFlag = true,
                DirectoryFlag = applicationPath
            };

            new RunCommand().Execute(request).ShouldBeTrue();

            files.FindFiles(templatePath, FileSet.Deep("*.htm")).Select(x => x.PathRelativeTo(applicationPath).Replace('\\', '/'))
                .OrderBy(x => x)
                .ShouldHaveTheSameElementsAs("_templates/en-US/Blue.htm", "_templates/en-US/Green.htm", "_templates/en-US/Red.htm");
        }
开发者ID:joemcbride,项目名称:fubumvc,代码行数:24,代码来源:generate_template_smoke_tester.cs

示例13: readProjects

 private static void readProjects(string directory, FileSystem system, Solution solution)
 {
     system.FindFiles(directory, new FileSet(){
         Include = "packages.config"
     }).Each(file =>
     {
         var project = Project.ReadFrom(file);
         solution._projects.Add(project);
     });
 }
开发者ID:ahjohannessen,项目名称:ripple,代码行数:10,代码来源:Solution.cs

示例14: readNugetSpecs

 private static void readNugetSpecs(string directory, SolutionConfig config, FileSystem system, Solution solution)
 {
     system.FindFiles(directory.AppendPath(config.NugetSpecFolder), new FileSet(){
         Include = "*.nuspec"
     })
         .Each(file =>
         {
             var spec = NugetSpec.ReadFrom(file);
             solution.AddNugetSpec(spec);
         });
 }
开发者ID:spascoe,项目名称:ripple,代码行数:11,代码来源:Solution.cs

示例15: readProjects

        private static void readProjects(string directory, FileSystem system, Solution solution)
        {
            var csProjSet = new FileSet(){
                Include = "*.csproj"
            };

            system.FindFiles(directory, csProjSet).Each(file =>
            {
                var project = Project.ReadFrom(file);

                solution.AddProject(project);
            });
        }
开发者ID:spascoe,项目名称:ripple,代码行数:13,代码来源:Solution.cs


注:本文中的FileSystem.FindFiles方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。