本文整理汇总了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;
}
示例2: CreateDataFolder
public static void CreateDataFolder()
{
var fileSystem = new FileSystem();
fileSystem.CleanDirectory("data");
fileSystem.DeleteDirectory("data");
fileSystem.Copy(FileSystem.Combine("..", "..", "data"), "data");
}
示例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");
}
示例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");
}
示例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());
}
示例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");
}
示例8: SetUp
public void SetUp()
{
system = new FileSystem();
system.CleanDirectory("firefly");
}