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


C# FileSystem.CleanDirectory方法代码示例

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


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

示例1: 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

示例2: CreateDataFolder

 public static void CreateDataFolder()
 {
     var fileSystem = new FileSystem();
     fileSystem.CleanDirectory("data");
     fileSystem.DeleteDirectory("data");
     fileSystem.Copy(FileSystem.Combine("..", "..", "data"), "data");
 }
开发者ID:KevM,项目名称:ripple,代码行数:7,代码来源:DataMother.cs

示例3: explode_smoke_test

        public void explode_smoke_test()
        {
            var file = new NugetFile("Bottles.1.0.0.441.nupkg", SolutionMode.Ripple);
            var system = new FileSystem();
            system.CreateDirectory("bottles");
            system.CleanDirectory("bottles");

            var package = file.ExplodeTo("bottles");

            package.ShouldNotBeNull();
            package.AssemblyReferences.Single().Name.ShouldEqual("Bottles.dll");
        }
开发者ID:bobpace,项目名称:ripple,代码行数:12,代码来源:NugetFileTester.cs

示例4: SetUp

        public void SetUp()
        {
            var fileSystem = new FileSystem();
            fileSystem.CreateDirectory("Solution1");
            fileSystem.CleanDirectory("Solution1");

            fileSystem.CreateDirectory(@"Solution1\docs");
            fileSystem.CreateDirectory(@"Solution1\harness");
            fileSystem.Copy("SlickGridHarness.csproj.fake", @"Solution1\harness\SlickGridHarness.csproj");
            fileSystem.Copy("FubuMVC.SlickGrid.Docs.csproj.fake", @"Solution1\docs\FubuMVC.SlickGrid.Docs.csproj");

            theSolutionProject = new SolutionProject("Project(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"FubuMVC.SlickGrid\", \"FubuMVC.SlickGrid\\FubuMVC.SlickGrid.csproj\", \"{A67A0CE1-E4C2-45FC-9019-829D434B2CC4}\"", "Solution1");
        }
开发者ID:awelburn,项目名称:FubuCsProjFile,代码行数:13,代码来源:ProjectReferenceTester.cs

示例5: 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

示例6: ExplodeTo

	    public IPackage ExplodeTo(string directory)
		{
			var explodedDirectory = directory.AppendPath(Name).ToFullPath();
			RippleLog.Info("Exploding to " + explodedDirectory);

			var fileSystem = new FileSystem();
			fileSystem.CreateDirectory(explodedDirectory);
			fileSystem.CleanDirectory(explodedDirectory);

			fileSystem.DeleteFile(FileName);

			fileSystem.WriteStringToFile(explodedDirectory.AppendPath(FileName), "");
			
			return new StubPackage(Name, Version.ToString());
		}
开发者ID:modulexcite,项目名称:ripple,代码行数:15,代码来源:StubNugetFile.cs

示例7: 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

示例8: SetUp

 public void SetUp()
 {
     system = new FileSystem();
     system.CleanDirectory("firefly");
 }
开发者ID:emiaj,项目名称:bottles,代码行数:5,代码来源:DeploymentSettingsTester.cs


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