本文整理汇总了C#中IFileSystem.WriteStringToFile方法的典型用法代码示例。如果您正苦于以下问题:C# IFileSystem.WriteStringToFile方法的具体用法?C# IFileSystem.WriteStringToFile怎么用?C# IFileSystem.WriteStringToFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFileSystem
的用法示例。
在下文中一共展示了IFileSystem.WriteStringToFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetUp
public void SetUp()
{
theSolution = new Solution
{
Directory = "SolutionFiles"
};
theFileSystem = new FileSystem();
theFileSystem.CreateDirectory("SolutionFiles");
theSolutionFiles = new SolutionFiles(theFileSystem, new SolutionLoader());
theSolutionFiles.RootDir = Path.GetTempPath().AppendRandomPath();
theFileSystem.CreateDirectory("SolutionFiles", "src");
theFileSystem.CreateDirectory("SolutionFiles", "src", "Project1");
theFileSystem.CreateDirectory("SolutionFiles", "src", "Project2");
theFileSystem.WriteStringToFile(Path.Combine("SolutionFiles", "src", "Project1", "Project1.csproj"), "test");
theFileSystem.WriteStringToFile(Path.Combine("SolutionFiles", "src", "Project2", "Project2.csproj"), "test");
}
示例2: SetUp
public void SetUp()
{
theSolution = new Solution
{
Directory = "SolutionFiles"
};
theFileSystem = new FileSystem();
theFileSystem.CreateDirectory("SolutionFiles");
theSolutionFiles = new SolutionFiles(theFileSystem, new SolutionLoader());
theSolutionFiles.RootDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SolutionFiles");
theFileSystem.CreateDirectory("SolutionFiles", "src");
theFileSystem.CreateDirectory("SolutionFiles", "src", "Project1");
theFileSystem.CreateDirectory("SolutionFiles", "src", "Project2");
theFileSystem.WriteStringToFile(Path.Combine("SolutionFiles", "src", "Project1", "Project1.csproj"), "test");
theFileSystem.WriteStringToFile(Path.Combine("SolutionFiles", "src", "Project2", "Project2.csproj"), "test");
}
示例3: SolutionExpression
public SolutionExpression(ISolutionGraphScenarioBuilder builder, string name)
{
_fileSystem = new FileSystem();
var solutionDir = Path.Combine(builder.Directory, name);
_fileSystem.CreateDirectory(solutionDir);
var solutionFile = Path.Combine(solutionDir, SolutionFiles.ConfigFile);
_fileSystem.WriteStringToFile(solutionFile, "");
_solution = new Solution
{
Name = name,
Path = solutionFile
};
_solution.Directory = solutionDir;
_solution.SourceFolder = Path.Combine(solutionDir, "src");
_solution.NugetSpecFolder = Path.Combine(solutionDir, "packaging", "nuget");
_fileSystem.CreateDirectory(_solution.SourceFolder);
builder.AddSolution(_solution);
_builder = builder;
_projects = new Cache<string, Project>(createAndAddProject);
addDefaultProject();
}